Parsing Get-Counter data to just get the values Parsing Get-Counter data to just get the values powershell powershell

Parsing Get-Counter data to just get the values


Pipe to Foreach-Object and get the value from the CounterSamples property. CounterSamples is an array and the value is in the first item:

Get-Counter -Counter "\Network Interface(Qualcomm Atheros AR9285 Wireless Network Adapter)\Bytes received/sec" -Continuous |Foreach-Object {$_.CounterSamples[0].CookedValue}