This web site uses Kentico CMS, the content management system for ASP.NET developers.
Community > Blogs > Max-PIT> PowerShell Blog > November 2008 > Using Get-Member (gm) with Out-File cmdlet...
 

Using Get-Member (gm) with Out-File cmdlet...


You can use the combination of "Get-member" with "Out-File" to help you get the list of Methods and Properties of your collection of .NET (or COM) objects from your $x variable.  In the following sample, you create a variable $x.  The purpose is to have another way to access the list of methods and properties so you won't open another PowerShell session in order to get to it.  I think this is a practical way to do it.  This way you can get the list from a notepad editor so you can see what's available. 


Sample Code

PS> $x = 'TEST'

PS> $x | gm | out-file -FilePath c:\temp\gm.txt ; ii c:\temp\gm.txt

 


Have fun!!
Max
Posted: 11/13/2008 11:09:08 AM by Global Administrator | with 0 comments


Comments There are no comments on this post.
This web site uses Kentico CMS, the content management system for ASP.NET developers.