Invoke-VMScript: An error occurred while sending the request

Posted by

After upgrading the PowerShell module to the latest version now available (11.3.0.13964823), my invoke-vmscript goes wrong. The following exception occurs:

Finally after a couple hours of troubleshooting, parameter checking and reinstalls we found the issue. The issue is caused by a untrusted certificate of the VMWare VCenter server.

To solve this the “recommended” way: Check and fix your certificates on your system and VCenter server.
The dirty “not recommended” way: Add the following code to your script.

3 comments

  1. I just started having this error after installing PowerShell 7. I tried uninstalling PowerShell 7 but the error persisted. What is weird is that I get the error but every Invoke-VMScript worked flawlessly other than puking red all over the screen.

    Thanks so much for posting this! I was about to go down the rabbit hole.

Leave a Reply

Your email address will not be published. Required fields are marked *