Create JSON object from PowerShell Get-WmiObject, Zabbix

This will generate:
{
 "data":[

 { "{#NAME}":"\\\\?\\Volume{b442274e-0000-0000-0000-100000000000}\\" , "{#LABEL}":"SYSTEM " , "{#CAPACITY}":"1074786304" },
 { "{#NAME}":"D:\\" , "{#LABEL}":"VOLUME LAB" , "{#CAPACITY}":"1073446912" },
 { "{#NAME}":"C:\\" , "{#LABEL}":"Windows" , "{#CAPACITY}":"94662291456" },
 { "{#NAME}":"C:\\Folder 1\\another one\\" , "{#LABEL}":"hello" , "{#CAPACITY}":"1073737728" },
 { "{#NAME}":"C:\\Folder 1\\third\\" , "{#LABEL}":"New Volume" , "{#CAPACITY}":"1073737728" },
 { "{#NAME}":"R:\\" , "{#LABEL}":"" , "{#CAPACITY}":"402649088" }

 ]
}
Validate the JSON:
https://jsonlint.com/

1 comment: