After installing or upgrading VMware vSphere PowerCLI in an offline environment using a ZIP file downloaded from the internet, executing commands such as Get-PowerCLIVersion fails with an error indicating that the module could not be loaded. Running Import-Module VMware.VimAutomation.Core outputs a FileLoadException error as follows:
PS C:\Users\Administrator> Import-Module VMware.VimAutomation.Core
Import-Module : Could not load file or assembly 'file:///C:\Program Files\WindowsPowerShell\Modules\VMware.VimAutomation.Cis.Core\net472\vmware.vapi.client.bindings.extended.dll' or one of its dependencies.
Operation is not supported. (Exception from HRESULT: 0x80131515)
At line:1 char:1
+ Import-Module VMware.VimAutomation.Core
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Import-Module], FileLoadException
+ FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand
Windows Server
Windows PowerShell
VMware vSphere PowerCLI
Because the downloaded ZIP file was extracted on the Windows OS without being unblocked, the execution of its internal files is blocked by Windows security features. This prevents PowerShell from loading the necessary DLL files, resulting in the error.
To resolve this issue, the ZIP file must be unblocked before being extracted and deployed again.
Close any open PowerShell windows.
Open Windows Explorer and delete all PowerCLI-related folders placed in the PowerShell module path.
Open the properties of the originally downloaded ZIP file.
On the General tab, under the Security section at the bottom right, check the Allow or Unblock box, click Apply, and then click OK.
Re-extract the unblocked ZIP file and deploy it to the PowerShell module path.
Launch a new PowerShell session and verify that the commands execute successfully.
Japanese version: オフラインインストール後の PowerCLI コマンド実行時のエラー(441992)