Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: Testing for property existance

$
0
0

Well, my developer answer would be that your command output should be considered a contract, and should be consistent, even if some properties sometimes have null values. Or, give your output object a type name that describes the kind of object it is. Then you can easily look at the type name and know what properties to expect.

To answer your question, pipe the object to GM and capture the output. Yo can easily see what properties exist that way.


Viewing all articles
Browse latest Browse all 13067

Trending Articles