PowerCLI: A command with name ‘Export-VM’ is already available on this system

When installing the PowerCLI module, you may get the following error during the installation process:

PackageManagement\Install-Package : A command with name ‘Export-VM’ is already available on this system. This module
‘VMware.VimAutomation.Core’ may override the existing commands. If you still want to install this module
‘VMware.VimAutomation.Core’, use -AllowClobber parameter.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1772 char:21
+ … $null = PackageManagement\Install-Package @PSBoundParameters
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Microsoft.Power….InstallPackage:InstallPackage) [Install-Package],
Exception
+ FullyQualifiedErrorId : CommandAlreadyAvailable,Validate-ModuleCommandAlreadyAvailable,Microsoft.PowerShell.Pack
ageManagement.Cmdlets.InstallPackage

This error is due to a module which is already available on the system containing that cmdlet. In my example, I have the Hyper-V PowerShell module installed on my machine.

To solve this issue, that’s pretty simple, you just have to append « -AllowClobber » parameter to the Install-Module cmdlet.

 

Thanks for reading! You can follow me on Twitter @PrigentNico

About Nicolas 230 Articles
I work as a System Engineer, based in Switzerland with a primary focus on Microsoft technologies. I have 7 years experience in administering Windows Servers. . I am a Microsoft MVP for Cloud & Datacenter Management. I also received the PowerShell Hero 2016 award by PowerShell.0rg. And finally, I am "MCSA: Windows Server 2012" and "Administering & Deploying SCCM" certified.