How Would I Convert PowerShell System.Object[] to String Value... in this case?
Solution 1:
You need to dig 1 level deeper and output the contents of the Patches
property, not the parent object that owns it:
Get-Content $pathToJsonFiles -Raw | ConvertFrom-Json |ForEach-Object -MemberName Patches | Export-Excel .\missing-patches.xlsx -WorksheetName $json_file.BaseName
The call to ForEach-Object Patches
will extract just the value(s) of that property from the input object (similar to Select-Object -ExpandProperty
)