Intellisense / get-member in Powershell

One of the neat tricks is write out what Methods, Properties get-member cmdlet.  Here are a couple of replies I recently from my question in the Powershell newsgroup.  

Example 1
-------------
It works well for static methods (note the parenthesis and square brackets
around the class name):

PS> get-member -in ([system.math]) -static


Example 2
-------------
You don't need to assign to a variable. You can pipe the new object into the get-member call:

new-object text.stringBuilder | get-member -memberType methods

If you don't want to create an instance at all, you can use reflection:

[text.stringBuilder].getMethods() | % { $_.name } | sort -unique

Published Tuesday, February 06, 2007 10:26 PM by steve schofield
Filed under:

Comments

# re: Intellisense / get-member in Powershell

Saturday, April 21, 2007 2:03 PM by Aaron Lerch

If you're looking for intellisense within the powershell console window, check out MoW's PowerTab along with my Invoke-Intellisense cmdlet:

http://blog.aaronlerch.com/2007/04/powertab-09-for-powershell-and-invoke.html

Cheers!