Wednesday 14 December 2011

PowerShell - Where is the IntelliSense??

Don't you wish PowerShell had IntelliSense?  If you need to find out what properties or methods an Object has you can create pass the object into the Get-Member cmdlet. and it will output the details

If you need to find out how to work with a string object load a variable with a string.
$test = "Test"
$test | Get-Member

You will get the following output


Name
MemberType
Definition
Clone
Method
System.Object Clone()
CompareTo       
Method               
int CompareTo(System.Object value), i...

Contains        
Method               
bool Contains(string value)

CopyTo          
Method               
System.Void CopyTo(int sourceIndex, c...

EndsWith        
Method               
bool EndsWith(string value), bool End...


This will of course work with SharePoint objects.

Happy Scripting!!

No comments:

Post a Comment