Skip to content

Installing the Module

Verify that your system has a supported edition and version of PowerShell installed.

Install the PowerShell module dependencies from the PowerShell Gallery by running the following commands:

Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Install-Module -Name VMware.PowerCLI -MinimumVersion 12.3.0 -Repository PSGallery
Install-Module -Name PowerVCF -Repository PSGallery

If using PowerShell Core, import the module before proceeding:

For example:

Import-Module -Name VMware.PowerCLI
Import-Module -Name PowerVCF

From Air-gapped Machine

Verify that your system has a supported edition and version of PowerShell installed.

Save Modules module dependencies from the PowerShell Gallery on a non air-gapped machine by running the following commands:

Save-Module -Name VMware.PowerCLI -Path F:\Module\ -Repository PSGallery
Save-Module -Name PowerVCF -Path F:\Module\ -Repository PSGallery

Copy the PowerShell Modules module dependencies from the Local Machine to air-gapped facing machine by running the following commands:

Copy-Item -Path F:\Module\* -Destination '\\<destination_host>\C$\Program Files\WindowsPowerShell\Modules\' -Recurse

Import the PowerShell Modules module dependencies from the air-gapped machine by running the following commands:

Import-Module -Name VMware.PowerCLI
Import-Module -Name PowerVCF

Prerequisite for module install on Linux Machine

mkdir /home/modules

Save Modules module dependencies from the PowerShell Gallery on a non air-gapped machine by running the following commands:

Save-Module -Name VMware.PowerCLI -Path /home/modules -Repository PSGallery
Save-Module -Name PowerVCF -Path /home/modules -Repository PSGallery

Copy the PowerShell Modules module dependencies from the Local Machine to air-gapped facing machine by running the following commands:

scp -r /home/modules/* username@remote_host:/home/lab/.local/share/powershell/Modules/

Import the PowerShell Modules module dependencies from the air-gapped machine by running the following commands in PowerShell:

Import-Module -Name VMware.PowerCLI
Import-Module -Name PowerVCF

Once installed, any cmdlets associated with PowerVCF will be available for use.

To view the cmdlets for available in the module, run the following command in the PowerShell console.

Get-Command -Module PowerVCF

To view the help for any cmdlet, run the Get-Help command in the PowerShell console.

For example:

Get-Help -Name <cmdlet-name>
Get-Help -Name <cmdlet-name> -Examples
Get-Help -Name <cmdlet-name> -Full