Environment/Setup: Using pwsh 7.1.3 on Windows Server 2019 and PowerCLI 12.3.0. I downloaded the zip of pwsh 7.1.3 and put PowerCLI in PowerShell-7.1.3-win-x64\Modules.
This is related to this - https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Connect-VIServer-The-SSL-connection-co.... However I was already doing this -
Set-PowerCLIConfiguration -ParticipateInCEIP $false -InvalidCertificateAction Ignore -DisplayDeprecationWarnings $false -WebOperationTimeoutSeconds (60*15) -Scope Session -Confirm:$false
And got this error -
Connect-VIServer: 5/11/2021 12:42:05 PM Connect-VIServer The SSL connection could not be established, see inner exception.
It only worked when I changed the scope from Session to User (didn't try AllUser).
What does Get-PowerCLIConfiguration return?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Appears to show the settings took, but connect throws that error for Session scope.
Import-Module VMware.VimAutomation.Core -EA STOP
Set-PowerCLIConfiguration -ParticipateInCEIP $false -InvalidCertificateAction Ignore -DisplayDeprecationWarnings $false -WebOperationTimeoutSeconds (60*15) -Scope Session -Confirm:$false | Out-Null
I just some further tests, and yes, the scope session for the InvalidCertificateAction doesn't seem to be taken into account.
That looks like a bug or incomplete documentation.
I suggest you open an SR
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Unfortunately, I don't have an active service contract. I would def say it's a bug though. The session scope settings should be honored just like user/alluser scopes.
It used to work before, must be something that was introduced later.
Perhaps only in the PSv7.* version.
Do you have a PSv5.1 where you can try the same?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yep it works on PS 5.1 (with scope session).
That's what I suspected.
It's apparently a flaw in the PSv7 version of PowerCLI.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference