简体   繁体   中英

How do I get the specific values in a JSON Output on PowerShell?

Get-AzureRmMetric -DetailedOutput -MetricName '\Processor Information(_Total)\% Processor Time'

This is the command and I only want the Average values. How do I extract it?

Here is how it looks like on the PS Window. enter image description here

This question was asked by me yesterday, and while I could not find a direct solution via PowerShell, I did make it work through Visual Studio. Here's what I did.

Based on a little bit of tinkering around, I stored the output as a String and then manipulated the string using the ' Regex.Split ' method.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM