Hi Rich,
It took a little bit, but I figured out what your answer meant. Before I could use the -Depth option, I had to download and install Powershell 7.3 on my desktop. The version of Powershell I was using was 5.1, where that option was not available.
I had to make two changes to my scripts, first to my powershell script, I added the -Depth option:
$fileNameParameter = $args[0]
$ItemToExtract = $args[1]
(Get-Content $fileNameParameter | ConvertFrom-Json).item | ? {$_.'Integrity ID' -eq $ItemToExtract } | ConvertTo-Json -Depth 10 | Out-File -Append .\extractedJSON.json
Add-Content -Path .\extractedJSON.json -Value ","
The second part was in my calling windows batch script, I had to update it to ensure that it used the new pwsh.exe command as opposed to powershell.exe:
pwsh.exe -File ExtractSingleJSONObject.ps1 %JSONSOURCEFILE% %%~a
Thanks for your help Rich