O'Reilly logo

Pro Windows PowerShell by Hristo Deshev

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

13.3. Getting Information About Objects

Quite often, we get an unidentified object from a cmdlet or another object. We were in that situation when we were working with AML objects previously. What can we do to get information about such objects? The answer is the Get-Member cmdlet. Get-Member lists an object's members: its properties, methods, fields, and so on. The easiest way to use it is to just pipe your objects through the cmdlet. Here is how we get a file item's properties:

PS> Get-Item test.txt | Get-Member TypeName: System.IO.FileInfo Name MemberType Definition ---- ---------- ---------- AppendText Method System.IO.StreamWriter App... CopyTo Method System.IO.FileInfo CopyTo(... Create Method System.IO.FileStream Create() CreateObjRef ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required