Select-PropertyValue
Thursday, June 11th, 2009 by Jeffery Hicks
Because PowerShell is all about the objects, I often point out to beginners to use the Select-Object cmdlet to see all the properties of an object and their values.
get-process powershell | select *
Using Get-Member is helpful to discover property names but sometimes you need to see a value to know which property or properties you really want to work with. That's where my Select-Object suggestion comes in. Unfortunately not every property is defined for every object so you can end up with a lot of empty properties. What I wanted was a way to only display properties for an object that have a value. Here's my solution.   More »