Failed to import module when use powercli
search cancel

Failed to import module when use powercli

book

Article ID: 414160

calendar_today

Updated On:

Products

VMware vCenter Server 8.0

Issue/Introduction

Symptom

 

  • Failed to import powercli module with error below:
    C:\temp\do> Import-Module VMware.VimAutomation.Core
    Import-Module : The required module 'VMware.Vim' is not loaded. Load the module or remove the module from 'RequiredModules' in the file 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\VMware.VimAutomation.Cis.Core\VMware.VimAutomation.Cis.Core.psd1'

 

  • No output from command below:
    C:\temp\do> Get-Module VMware.VimAutomation.Core

 

Environment

VMware PowerCLI

Cause

Powercli files are not unblocked and modules are not installed yet.

Resolution

  • Please unblock files and install as per below document.

          https://techdocs.broadcom.com/us/en/vmware-cis/vcf/power-cli/latest/powercli/installing-vmware-vsphere-powercli/install-powercli-offline.html

  • For Windows, run the command to unblock the copied files.
     Get-ChildItem -Path 'folder_path' -Recurse | Unblock-File

          Replace folder_path with the path to the folder where you extracted the contents of the ZIP file.

  • Verify that the VMware PowerCLI modules have installed successfully.
     Get-Module VMware* -ListAvailable