讀取json文檔
$json = (Get-Content "C:\HDDList.json" -Raw) | ConvertFrom-Json
$select=$json.Content.selected[0]
$HddCoun=$json.Content.normal.Count
遍歷數組
foreach($str in $json.versions) {
echo "value: $str"
}
json數據轉換psobject.properties
$json = (Get-Content "C:\nowSelect.json" -Raw) | ConvertFrom-Json
$select=$json.Content.selected[0].psobject.properties.Name
$selectValue=$json.Content.selected[0].psobject.properties.Value