PowerCLI

 View Only
Expand all | Collapse all

not able to install powercli on powershell

  • 1.  not able to install powercli on powershell

    Posted Aug 05, 2019 04:36 PM

    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?



  • 2.  RE: not able to install powercli on powershell

    Posted Aug 05, 2019 04:47 PM

    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



  • 3.  RE: not able to install powercli on powershell

    Posted Jun 02, 2020 12:52 AM

    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.



  • 4.  RE: not able to install powercli on powershell

    Posted Jun 02, 2020 06:44 AM

    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



  • 5.  RE: not able to install powercli on powershell

    Posted Jun 05, 2020 06:32 PM

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

    LucD



  • 6.  RE: not able to install powercli on powershell

    Posted Jun 05, 2020 03:50 PM

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



  • 7.  RE: not able to install powercli on powershell

    Posted Jun 05, 2020 04:13 PM

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



  • 8.  RE: not able to install powercli on powershell

    Posted Jun 05, 2020 04:29 PM

    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:



  • 9.  RE: not able to install powercli on powershell

    Posted Jun 05, 2020 05:03 PM

    What does it say when you do

    Install-Module -Name VMware.PowerCLI -Verbose



  • 10.  RE: not able to install powercli on powershell

    Posted Jun 05, 2020 05:13 PM

    Does this help



  • 11.  RE: not able to install powercli on powershell

    Posted Jun 05, 2020 05:19 PM

    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



  • 12.  RE: not able to install powercli on powershell

    Posted Jun 05, 2020 05:27 PM

    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.



  • 13.  RE: not able to install powercli on powershell

    Posted Jun 05, 2020 06:12 PM

    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.



  • 14.  RE: not able to install powercli on powershell

    Posted Jun 05, 2020 07:08 PM

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



  • 15.  RE: not able to install powercli on powershell

    Posted Jun 05, 2020 07:27 PM

    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



  • 16.  RE: not able to install powercli on powershell

    Posted Jun 05, 2020 07:43 PM

    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.