PowerShell Get-Member

In the past when I have wanted to find out the names of the fields used by get-scomalert, get-scommanagementpack, get-scomagent etc I have piped the command to a csv file and opened it up in Excel. Just recently I have found out about get-member. This is great for getting a list of the properties or a command so you can find out what the fields are.

Examples
get-scomalert | Get-Member
get-scommanagementpack | Get-Member
get-scomagent | Get-Member

As well as finding out the name of the property it tells you whether you can change it. For example in get-scomalert:

NetbiosComputerName Property string NetbiosComputerName {get;}
Owner Property string Owner {get;set;}

NetbiosComputerName cannot be changed but Owner can as you can see a set as well as a get.

About these ads

Comments are closed.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: