VMware Cloud Community
devopsnoob
Contributor
Contributor
Jump to solution

Installing PowerCLI

Hello,

Is it possible to use the zip download from https://code.vmware.com/web/tool/11.2.0/vmware-powercli to install PowerCLI?  Or use it as an upgrade to existing install?

 

Many thanks

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Since you installed from the downloaded ZIP file, did you 'unblock' the folders/files after you copied them?

Get-ChildItem -Path 'C:\Users\Username\Documents\WindowsPowerShell\Modules\VMware*' -Recurse |

Unblock-File


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
11 Replies
LucD
Leadership
Leadership
Jump to solution

Yes, you can.


Just unzip the archive into one of the folders that are listed in $env:PSModulePath.
If you have an older release installed, just delete those folders before extracting the new files.
These folders all start with the name VMware.VimAutomation and VMware.VumAutomation.

If you have a very old version installed through a MSI file, you will first have to unistall through the Programs and Features control panel applet.

Once uninstalled, have a look in the Program Files (x86) folder if any PowerCLI folders are left behind.

If yes, just delete these folders manually.

Be aware that the folders in the ZIP file do not contain the version number subfolder.

As a result, in PS v5.*, you can't have multiple versions of the modules installed next to each other.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
devopsnoob
Contributor
Contributor
Jump to solution

I have tried this and everything I get a script warning...and do you want to run..I say yes, and continue without displaying any errors which I assume is a good thing.

Then I intiate, connect-viserver -server <fqdn> and i get an error...command module was found in 'VMware.VimAutomation.Core', but the module could not be loaded.....

Am I missing?  I have extracted the content of the zip file into c:\users\<username>\documents\WindowsPowerShell\Modules

 

Thanks

0 Kudos
devopsnoob
Contributor
Contributor
Jump to solution

also tried importing the module direct...

import-module VMware.VimAutomation.Core

but this generates an error of operation not supported / file load exeption.  The specific file is InternalVimService50.Wcf.dll

0 Kudos
LucD
Leadership
Leadership
Jump to solution

I suspect your installation might be corrupted one way or the other.

Can you first do

$PSVersionTable

and

$env:PSModulePath

Then do a

Get-Module -Name VMware* -ListAvailable

Please attach screenshots from the output.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
devopsnoob
Contributor
Contributor
Jump to solution


PS C:\> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.17763.316
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.316
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1


PS C:\> $env:PSModulePath -split ';'
C:\Users\Username\Documents\WindowsPowerShell\Modules
C:\Program Files\WindowsPowerShell\Modules
C:\Windows\system32\WindowsPowerShell\v1.0\Modules
PS C:\>
PS C:\> Get-Module -Name VMware* -ListAvailable | ft -AutoSize


    Directory: C:\Users\Username\Documents\WindowsPowerShell\Modules


ModuleType Version         Name                                ExportedCommands
---------- -------         ----                                ----------------
Script     6.7.0.11233116  VMware.DeployAutomation             {Add-DeployRule, Add-ProxyServer, Add-ScriptBundle, C...
Script     6.7.0.11233116  VMware.ImageBuilder                 {Add-EsxSoftwareDepot, Add-EsxSoftwarePackage, Compar...
Manifest   11.2.0.12483598 VMware.PowerCLI
Script     6.7.0.12483609  VMware.Vim
Script     11.2.0.12483642 VMware.VimAutomation.Cis.Core       {Connect-CisServer, Disconnect-CisServer, Get-CisServ...
Script     11.0.0.10379994 VMware.VimAutomation.Cloud          {Add-CIDatastore, Connect-CIServer, Disconnect-CIServ...
Script     11.2.0.12483627 VMware.VimAutomation.Common
Script     11.2.0.12483638 VMware.VimAutomation.Core           {Add-PassthroughDevice, Add-VirtualSwitchPhysicalNetw...
Script     11.2.0.12483619 VMware.VimAutomation.Hcx            {Connect-HCXServer, Disconnect-HCXServer, Get-HCXAppl...
Script     7.6.0.10230451  VMware.VimAutomation.HorizonView    {Connect-HVServer, Disconnect-HVServer}
Script     10.0.0.7893904  VMware.VimAutomation.License        Get-LicenseDataManager
Script     11.2.0.12483633 VMware.VimAutomation.Nsxt           {Connect-NsxtServer, Disconnect-NsxtServer, Get-NsxtP...
Script     11.2.0.12483635 VMware.VimAutomation.Sdk            Get-ErrorReport
Script     11.0.0.10380515 VMware.VimAutomation.Security       {Get-SecurityInfo, Get-VTpm, Get-VTpmCertificate, Get...
Script     11.2.0.12483605 VMware.VimAutomation.Srm            {Connect-SrmServer, Disconnect-SrmServer}
Script     11.2.0.12483611 VMware.VimAutomation.Storage        {Add-KeyManagementServer, Copy-VDisk, Export-SpbmStor...
Script     1.3.0.0         VMware.VimAutomation.StorageUtility Update-VmfsDatastore
Script     11.2.0.12483615 VMware.VimAutomation.Vds            {Add-VDSwitchPhysicalNetworkAdapter, Add-VDSwitchVMHo...
Script     11.2.0.12483614 VMware.VimAutomation.Vmc            {Connect-Vmc, Disconnect-Vmc, Get-VmcSddcNetworkServi...
Script     10.0.0.7893921  VMware.VimAutomation.vROps          {Connect-OMServer, Disconnect-OMServer, Get-OMAlert, ...
Script     6.5.1.7862888   VMware.VumAutomation                {Add-EntityBaseline, Copy-Patch, Get-Baseline, Get-Co...

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Can you check what the following returns?
Correct the path with the correct UserName.

Import-Module "C:\Users\Username\Documents\WindowsPowerShell\Modules\VMware.VimAutomation.Core" -Verbose


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
devopsnoob
Contributor
Contributor
Jump to solution

PS C:\> Import-Module "C:\Users\Username\Documents\WindowsPowerShell\Modules\VMware.VimAutomation.Core" -verbose
VERBOSE: Loading module from path
'C:\Users\Username\Documents\WindowsPowerShell\Modules\VMware.VimAutomation.Core\VMware.VimAutomation.Core.psd1'.

Security warning
Run only scripts that you trust. While scripts from the internet can be useful, this script can potentially harm your
computer. If you trust this script, use the Unblock-File cmdlet to allow the script to run without this warning
message. Do you want to run
C:\Users\Username\Documents\WindowsPowerShell\Modules\VMware.VimAutomation.Cis.Core\VMware.VimAutomation.Cis.Core.psm1?
[D] Do not run  [R] Run once  [S] Suspend  [?] Help (default is "D"): r
Import-Module : Could not load file or assembly 'file:///C:\Users\Username\Documents\WindowsPowerShell\Modules\VMware.Vi
mAutomation.Cis.Core\net45\vmware.vapi.client.bindings.extended.dll' or one of its dependencies. Operation is not
supported. (Exception from HRESULT: 0x80131515)
At line:1 char:1
+ Import-Module "C:\Users\Username\Documents\WindowsPowerShell\Modules\V ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Import-Module], FileLoadException
    + FullyQualifiedErrorId : FormatXmlUpdateException,Microsoft.PowerShell.Commands.ImportModuleCommand

PS C:\> Get-ExecutionPolicy
Unrestricted
PS C:\>

0 Kudos
devopsnoob
Contributor
Contributor
Jump to solution

I see my error, the files were blocked...and blocking the zip file before extraction resolved the entire issue.
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Since you installed from the downloaded ZIP file, did you 'unblock' the folders/files after you copied them?

Get-ChildItem -Path 'C:\Users\Username\Documents\WindowsPowerShell\Modules\VMware*' -Recurse |

Unblock-File


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
LucD
Leadership
Leadership
Jump to solution

Seems you came to the same conclusion :smileygrin:


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
SandySME
Contributor
Contributor
Jump to solution

This fixed my issue, thanks a lot for the help!

0 Kudos