Analyze Cmdlet Results

Share |

Subscribe to Feed

PowerShell eBook
Sign up for
Your PowerTip of the Day:

Powershell Plus

13 Free SQL Tools from Idera

Free Ebook: Mastering Powershell


There are two great ways to analyze the results a cmdlet returns: you can send the results to Get-Member to get a formal analysis, telling you the properties, methods and data types, and you can send them to Select-Object to view the actual property content to get a feeling where to look for specific information. Check this out:

Get-Process | Get-Member
Get-Process | Select-Object -property * -First 1

Note the use of -First 1: this gets you only the first result which most of the time is sufficient for analysis.


Twitter This Tip! ReTweet this Tip!

Posted Jul 11 2011, 06:00 AM by ps1
Copyright 2012 All rights reserved.