When PowerShell's LanguageMode is ConstrainedLanguage, if you execute Connect-VIServer cmdlet you can see similar to the following error.
PS C:\Users\Administrator> $ExecutionContext.SessionState.LanguageMode = "ConstrainedLanguage"
PS C:\Users\Administrator> $ExecutionContext.SessionState.LanguageMode
ConstrainedLanguage
PS C:\Users\Administrator> Connect-VIServer -Server ###.###.###.###
Connect-VIServer : Specified method is not supported.
At line:1 char:1
+ Connect-VIServer -Server ###.###.###.###
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotImplemented: (:) [Connect-VIServer], PSNotSupportedException
+ FullyQualifiedErrorId : NotSupported,VMware.VimAutomation.ViCore.Cmdlets.Commands.ConnectVIServer
PowerCLI
VMware vCenter Server 8.x
VMware vCenter Server 7.x
VMware vSphere ESXi 8.x
VMware vSphere ESXi 7.x
ConstrainedLanguage causes an error because it lacks execution permissions in the internal processing of PowerShell when Connect-VIServer cmdlet be executed.
This error can be avoided by using Connect-VIServer's parameter -NotDefault.
In PowerShell, as shown below the steps, store the result of specifying -NotDefault parameter with Connect-VIServer cmdlet in a variable, and then specify that variable using the -Server parameter each time you execute a cmdlet.
Steps:
1. Store the result of specifying -NotDefault parameter with Connect-VIServer cmdlet in a variable as shown below.
$conn = Connect-VIServer -Server <IP address> -NotDefault
* Enter your username and password as needed.
2. When executing the PowerCLI cmdlet as shown below, specify the variable in Step 1 using the -Server parameter.
Get-VM -Server $conn