Hi, Newbie question here: How do I get the value of of the PM Object itself?
Get-Process -Name powershell_ise | Select-Object PM
This is beautiful, Thanks!
The "Select-Object" returns a PSCustomObject that has a TypeName of Selected.System.Diagnostics.Process, and that has "NoteProperty" attributes that act as hash tables (in this case) that have a name (in this case PM) and a definition (in this case "long PM=202792960").
You can get the value of that NoteProperty like this:
(Get-Process "powershell_ise" | Select-Object PM).pm
Or, like this to just return return the value of the PM (which is an alias for the actual property "PagedMemorySize64"):
Get-Process "powershell_ise" | Select-Object -ExpandProperty PM
I'd suggest that you visit this URL (Windows-PowerShell-4) and download the free copy of the book. It's written in easily digestible chapters and you learn a lot be reading just the 1st half.
9 people are following this question.