VMware.VimAutomation.Vpc module does not autoload in VCF PowerCLI
search cancel

VMware.VimAutomation.Vpc module does not autoload in VCF PowerCLI

book

Article ID: 412787

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

When using VCF PowerCLI, cmdlets from the VMware.VimAutomation.Vpc module are not available until the module is explicitly imported.

Environment

  • VCF PowerCLI version 9.0 - 24798382 installed from PowerShell Gallery or Developer portal
  • VCF 9.x
  • NSX 9.x

Cause

This happens because the module manifest for vpc4powercli does not export any cmdlets and is not available for autoloading.

Resolution

To work around this issue, explicitly import the VMware.VimAutomation.Vpc module before running any cmdlets: -

Import-Module VMware.VimAutomation.Vpc

After importing, you can successfully run cmdlets such as: -

New-VPC -Name "TestVpc" -Description "Example VPC"

Example Without Import: -

PS C:\> New-VPC -Name "TestVpc"

It shows error: The term 'New-VPC' is not recognized as the name of a cmdlet.

After Import: -

PS C:\> Import-Module VMware.VimAutomation.Vpc

PS C:\> New-VPC -Name "TestVpc" -Description "Example VPC" <<<<<<<< Recognizes 'New-VPC' cmdlet and creates VPC with name 'TestVpc'