Need help with how I can explicitly list the key names and its values for the below JSON using powershell.
{
"Data": {
"OS_Support": {
"SupportedOS": [
"Microsoft Windows 10",
"Microsoft Windows 11"
]
},
"MinFreeDiskSpace": {
"SupportedDisk": 20
},
"MinMemorySize": {
"SupportedMemory": 8
},
"App": {
"Name": "Notepad",
"Version": "1.2.3.4"
}
}
}
E.g. looking for output as below. Want to list the output with the last key name and its value.
SupportedOS Microsoft Windows 10, Microsoft Windows 11
SupportedDisk 20
SupportedMemory 8
Name Notepad
Version 1.2.3.4
I am trying to use below but it doesnt help. Any pointers would be really helpful,
(Get-Content -Path "JsonPath" | ConvertFrom-Json ).Data | Get-Member | Where-Object { $_.MemberType -match "Property" }