Reputation: 13
I'm am working to get a powershell command that allows me to pull the average cpu percentage over all the cores for a remote server, and output the value as just the numeric percentage. I am Close but have not been able find a way to just get the Numeric value. The Following is the command I am using followed by the output.
Get-WmiObject -computer server -class win32_processor | Measure-Object -property LoadPercentage -Average | FL average
Average : 30.5
Thanks in advance for any Help!
Upvotes: 1
Views: 10165
Reputation: 54841
Try Select-Object
's ExpandProperty
parameter to get the value of a property. Updated script:
Get-WmiObject -computer server -class win32_processor | Measure-Object -property LoadPercentage -Average | Select-Object -ExpandProperty Average
Upvotes: 1