Skip to content

Installing the Module

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

For environments connected to the Internet, you can install the module dependencies from the PowerShell Gallery by running the following commands in the PowerShell console:

Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Install-Module -Name VMware.PowerCLI -MinimumVersion 13.3.0 -Repository PSGallery
Install-Module -Name PowerVCF -MinimumVersion 2.4.1 -Repository PSGallery
Install-Module -Name PowerValidatedSolutions -MinimumVersion 2.11.0 -Repository PSGallery
Install-Module -Name Posh-SSH -MinimumVersion 3.0.8 -Repository PSGallery
Install-Module -Name VMware.CloudFoundation.PowerManagement -Repository PSGallery

In PowerShell Core, import the modules before proceeding:

For example:

Import-Module -Name VMware.CloudFoundation.PowerManagement

For environments disconnected from the Internet (e.g., dark-site, air-gapped), you can save the module dependencies from the PowerShell Gallery by running the following commands in the PowerShell console:

From a system with an Internet connection, save the module dependencies from the PowerShell Gallery by running the following commands in the PowerShell console:

Save-Module -Name VMware.PowerCLI -MinimumVersion 13.3.0 -Path F:\Module\ -Repository PSGallery
Save-Module -Name PowerVCF -MinimumVersion 2.4.1 -Path F:\Module\ -Repository PSGallery
Save-Module -Name PowerValidatedSolutions -MinimumVersion 2.11.0 -Path F:\Module\ -Repository PSGallery
Save-Module -Name Posh-SSH -MinimumVersion 3.0.8 -Path F:\Module\ -Repository PSGallery
Save-Module -Name VMware.CloudFoundation.PowerManagement -Path F:\Module\ -Repository PSGallery

From the system with the Internet connection, copy the module dependencies to a target system by running the following commands in the PowerShell console:

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

On the target system, import the module dependencies by running the following commands in the PowerShell console:

Import-Module -Name VMware.CloudFoundation.PowerManagement

Prerequisite for module install on Linux Machine

$DownloadDir = "~/DownloadModules"
mkdir $DownloadDir

From a system with an Internet connection, save the module dependencies from the PowerShell Gallery by running the following commands in the PowerShell console:

Save-Module -Name VMware.PowerCLI -Path $DownloadDir -Repository PSGallery
Save-Module -Name PowerVCF -Path $DownloadDir -Repository PSGallery
Save-Module -Name Posh-SSH -Path $DownloadDir -Repository PSGallery
Save-Module -Name PowerValidatedSolutions -Path $DownloadDir -Repository PSGallery
Save-Module -Name VMware.CloudFoundation.PowerManagement -Path $DownloadDir -Repository PSGallery
cd $DownloadDir
tar -zcvf OfflineModules.tar.gz *

From the system with an Internet connection, copy the OfflineModules.tar.gz archive to a target system's directory:

~/.local/share/powershell/Modules/

On the target system, extract the archive uploaded in the previous step by running the following commands:

cd ~/.local/share/powershell/Modules/
tar -zxvf OfflineModules.tar.gz
rm -rf OfflineModules.tar.gz
On the target system, import the module dependencies by running the following commands in the PowerShell console:

Import-Module -Name VMware.CloudFoundation.PowerManagement

Once installed, any cmdlets associated with VMware.CloudFoundation.PowerManagement and the its dependencies 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 VMware.CloudFoundation.PowerManagement

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