VMware Cloud Community
rastickland
Enthusiast
Enthusiast

not able to install powercli on powershell

good morning.  my org just upgraded me to windows 10.  Yay!  however, i am not able to install powercli on powershell.  i have downloaded the package and extracted same and put it in my modules folder.   i have followed this article https://aventistech.com/install-powercli-10-on-windows-10/

Set-ExecutionPolicy RemoteSigned
#Install NuGet
Install-PackageProvider -Name NuGet -RequiredVersion 2.8.5.201 -Force  (this was successful)

Save-Module -Name VMware.PowerCLI -Path C:\Temp\PowerCLI

PackageManagement\Save-Package : No match was found for the specified search criteria and module name 'VMware.PowerCLI'. Try Get-PSRepository to see all

available registered module repositories.

At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1598 char:21

+             $null = PackageManagement\Save-Package @PSBoundParameters

+                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : ObjectNotFound: (Microsoft.Power...ets.SavePackage:SavePackage) [Save-Package], Exception

    + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.SavePackage

Install-Module Vmware.PowerCLI -Force

PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'Vmware.PowerCLI'. Try Get-PSRepository to see

all available registered module repositories.

At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21

+ ...          $null = PackageManagement\Install-Package @PSBoundParameters

+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception

    + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

PS C:\Windows\system32> Get-PSRepository

WARNING: Unable to find module repositories.

PS C:\Windows\system32>  $PSVersionTable.PSVersion

Major  Minor  Build  Revision

-----  -----  -----  --------

5      1      16299  98  

PS C:\Windows\system32> Get-PackageProvider -ListAvailable

Name                     Version          DynamicOptions                                                                                                  

----                     -------          --------------                                                                                                  

msi                      3.0.0.0          AdditionalArguments                                                                                             

msu                      3.0.0.0                                                                                                                          

nuget                    2.8.5.201                                                                                                                        

NuGet                    2.8.5.208        Destination, ExcludeVersion, Scope, SkipDependencies, Headers, FilterOnTag, Contains, AllowPrereleaseVersions,...

PowerShellGet            1.0.0.1          PackageManagementProvider, Type, Scope, AllowClobber, SkipPublisherCheck, InstallUpdate, NoPathUpdate, Filter,...

Programs                 3.0.0.0          IncludeWindowsInstaller, IncludeSystemComponent                                                                 

thoughts?

0 Kudos
15 Replies
LucD
Leadership
Leadership

Your PowerShellGetversion is quite old, can you try to upgrade that first?

You will probably need to run this as Administrator

Install-Module –Name PowerShellGet –Force


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

0 Kudos
Igor_The_Great_
Contributor
Contributor

I'm having the same problem and the

> Install-Module -Name PowerShellGet -Force

PackageManagement\Install-Package : No match was found for the specified search criteria and module name 'PowerShellGet'. Try

Get-PSRepository to see all available registered module repositories.

At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1809 char:21

+ ...          $null = PackageManagement\Install-Package @PSBoundParameters

+                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : ObjectNotFound: (Microsoft.Power....InstallPackage:InstallPackage) [Install-Package], Exception

    + FullyQualifiedErrorId : NoMatchFoundForCriteria,Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

> Get-PSRepository

WARNING: Unable to find module repositories.

0 Kudos
LucD
Leadership
Leadership

Are you perhaps behind a proxy?

If yes, try the following (change to your proxy + port)

[system.net.webrequest]::defaultwebproxy = New-Object system.net.webproxy('http://proxy:port')

[system.net.webrequest]::defaultwebproxy.credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials

[system.net.webrequest]::defaultwebproxy.BypassProxyOnLocal = $true

Then do

Register-PSRepository -Default


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

mk5213
Contributor
Contributor

I am having the exact same problem, did you ever find a fix?

0 Kudos
LucD
Leadership
Leadership

If you also have that same old PowerShellGet version, you will have to upgrade that first.


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

0 Kudos
mk5213
Contributor
Contributor

I'm actually running PowerShell on a RHEL7 server, I got the latest version from the repository but am running into a bunch of problems, I did what you did regarding the proxy but I'm still receiving these errors, do you know if VMware.VimAutomation.Core will run on Linux anyways? Also here are my errors if it helps:

0 Kudos
LucD
Leadership
Leadership

What does it say when you do

Install-Module -Name VMware.PowerCLI -Verbose


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

0 Kudos
mk5213
Contributor
Contributor

Does this help

0 Kudos
LucD
Leadership
Leadership

That error mostly shows when you are behind a proxy.

Does this make a difference?

$webclient=New-Object System.Net.WebClient

$webclient.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials

[Net.ServicePointManager]::SecurityProtocol = "tls12"


Install-Module -Name VMware.PowerCLI -Verbose


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

mk5213
Contributor
Contributor

Here is what I get, I also tried what you suggested the original person with my proxy credentials, but it did not work either. Sorry if I don't know enough about this stuff, I am currently just an intern working on a linux server remotely and having trouble getting modules installed.

0 Kudos
LucD
Leadership
Leadership

It might be something with the proxy.

You could try using the proxy parameters on the Install-Module cmdlet, and see if that makes a difference.

$cred = New-Object -TypeName PSCredential -ArgumentList $user,(ConvertTo-SecureString -String $pswd -AsPlainText -Force)

Install-Module -Name VMware.PowerCLI -proxy http://<your-proxy> -ProxyCredential $cred -Verbose

Also, which PowerShell version do you have installed?

Do a $PSVersionTable

There have been some long discussions on this issue on the PowerShell repo, see issue #7827

And there have been many proposed solutions, including the TLS version.


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

0 Kudos
rastickland
Enthusiast
Enthusiast

so running the command below actually resolved my issue. Thank you for the help

LucD

0 Kudos
mk5213
Contributor
Contributor

Which statement resolved your issue? Here is the version I have currently. Is there a known issue with this version?

0 Kudos
rastickland
Enthusiast
Enthusiast

i ran what is below as two different commands and it worked or me. 

$webclient=New-Object System.Net.WebClient

$webclient.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials

[Net.ServicePointManager]::SecurityProtocol = "tls12"

Install-Module -Name VMware.PowerCLI -Verbose

0 Kudos
LucD
Leadership
Leadership

No, the issue I referred to was in version 6.1

I'm afraid I'm at my wits end here.
Can you perhaps with the team that administrates the proxy?

They might be able to see in the proxy logs what is blocking, if anything at all.


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

0 Kudos