I am trying to loop through the below JSON file in PowerShell.
Without specifically naming the top tags (e.g. 17443 and 17444), as I do not know them in advance I ca
Here's a simple regex-based solution. Assuming that $sRawJson contains your JSON input:
$oRegex = [Regex]'(?:(?<="[345]":\{"value"\:\["))[^"]+'
$cParts = $oRegex.Matches(($sRawJson -replace '\s')) | Select-Object -ExpandProperty "Value"
Joining parts to get full names:
for ($i = 0; $i -lt $cParts.Count / 3; $i++) { $cParts[($i * 3)..($i * 3 + 2)] -join ' ' }