Closed daxian-dbw closed 2 years ago
Quoted from: https://stackoverflow.com/a/68580426:
In Json.NET 13.0.1, Newtonsoft changed the default MaxDepth for JsonReader (and hence all derived reader types including JsonTextReader) to 64:
Change - JsonReader and JsonSerializer MaxDepth defaults to 64
The ConvertFrom-Json
command in PowerShell already specified the MaxDepth
in JsonSerializerSettings
, so it should not be affected. Therefore, it's likely that the PowerCLI module is directly calling APIs from Newtonsoft.Json.dll
, and should be updated accordingly. @xenadmin can you please open an issue in https://github.com/vmware/PowerCLI-Example-Scripts about this?
Additionally I opened an official VMware support request (21277890011) as per: https://blogs.vmware.com/PowerCLI/2017/08/powercli-support-breakdown.html
Hi @xenadmin , thanks for reporting this . Do you know if VMware Support provided you with an Update/ETA on this issue ? It also affect function Get-CisService
I got a phone call from VMware the next day, where they acknowledged the issue, informed me that they will immediately close the case, as this will be tracked here in this Github issue, and told me to watch out for newer releases of PowerCLI. To workaround this this issue, I had to downgrade to PowerShell LTS in the meantime.
I can confirm that we're aware of the issue and we're working to address it in the next PowerCLI version.
@kamennikolov - can you please share the workaround until the new version of PowerCLI is released?
Currently the only workaround is to use an older PowerShell version - 7.0 or 7.1. Another workaround would be to refactor this module to use the new SDK modules, instead of Get-CisService for accessing the API.
@mcarpendale In my use-case, I have Debian (10) VMs, with powershell and powercli, where my scripts fail. On Debian I had to downgrade to powershell-lts
to make everything work again, which looks like this as of today:
thanks @kamennikolov and @xenadmin - 7.1.5 is working from me again
Confirmed still not working with Powershell 7.2.1 and PowerCLI 12.4.1 Using Windows Powershell 5.1 is fine
PowerCLI 12.5 resolved the issue on Powershell 7.2.1 for me https://vdc-download.vmware.com/vmwb-repository/dcr-public/02623a82-abc4-421c-a788-87578bd66208/5ac43430-05f3-489e-af9c-c8de75b65de7/vmware-powercli-125-release-notes.html
Steps to reproduce
PowerShell 7.2.0 (The error does not appear with PowerShell 7.0 LTS or with 7.1.5.) Install VMware PowerCLI Import Module: https://github.com/vmware/PowerCLI-Example-Scripts/blob/master/Modules/Backup-VCSA/**Backup-VCSA.psm1** Connect-CisServer Get-VCSABackupJobs
Expected behavior
Actual behavior
Error details
Environment data