page contents My title page contents A Blog on Tools, Techniques and Announcements: PowerShell-Day6

Wednesday, August 24, 2016

PowerShell-Day6


Using the Get-Member Command (gm)
Lets look at an example
image
Now look at the output above, the command will give you the output as per the instructions of the config file, you need to decide and filter or sort the data as per you need
So we need to know what are the columns available that are available for use with the above command

Each Row in an Object
image
and each Column is a Property
image
So lets see the Property using the same cammand
imageGet-EventLog -LogName System -Newest 50 | Get-Member
or
Get-EventLog -LogName System -Newest 50 | gm
The output would be the same
image
Even if it says ScriptProperty it’s still a Property
EventID is InstanceID as shown below
image
you can use the GM command with any command that can be piped
Eg :
Get-Process | gm
Get-Service | gm

No comments:

Post a Comment