Automation

 View Only
  • 1.  Cannot install PowerCLI

    Posted Jan 18, 2023 11:08 PM

    Hello,

    I am trying to install PowerCLI using the following commands 

    Install-Module -Name PowerShellGet -RequiredVersion 2.2.5 -Force

    This one returns a Warning:

    WARNING: The version '1.4.8.1' of module 'PackageManagement' is currently in use. Retry the operation after closing the applications.

    I have removed and the module and installed it again, tried to proceed with the next step:

    Install-Module -Name VMware.PowerCLI -SkipPublisherCheck -Force -AllowClobber

    But getting this error:

    PackageManagement\Install-Package : Package 'VMware.Vim' failed to be installed because: The process cannot access the file 'C:\Users\gmohammed\AppData\Local\Temp\xs5ns0ff\netcoreapp2.0\VMware.Vim.dll' because it is being used by another process. At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\2.2.5\PSModule.psm1:9710 char:34 + ... talledPackages = PackageManagement\Install-Package @PSBoundParameters + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidResult: (VMware.Vim:String) [Install-Package], Exception
    + FullyQualifiedErrorId : Package '{0}' failed to be installed because: {1},Microsoft.PowerShell.PackageManagement.Cmdlets.InstallPackage

    I spent quite some time searching\Googling to get a solution but no luck.

    I appreciate any help, thanks!



  • 2.  RE: Cannot install PowerCLI

    Posted Jan 19, 2023 07:17 AM

    Can you try using a PowerShell session started as Administrator?
    Then try to upgrade the module with 

    Update-Module -Name PowerShellGet -RequiredVersion 2.2.5

     



  • 3.  RE: Cannot install PowerCLI

    Posted Jan 19, 2023 02:06 PM
      |   view attached

    The command went fine, but when I tried to install PowerCLI I got the same error, screenshot attached.

    Thanks,

     



  • 4.  RE: Cannot install PowerCLI

    Posted Jan 19, 2023 02:19 PM


  • 5.  RE: Cannot install PowerCLI

    Posted Jan 19, 2023 09:43 PM

    I have tried steps from the provided link and the other link, deleted all content of temp folder, restarted, and still the same.

    I have attached some screenshots hope that helps.

     



  • 6.  RE: Cannot install PowerCLI

    Posted Jan 19, 2023 09:53 PM

    The solution from that thread I pointed to was that the user had Visual Studio installed.
    After removing that, the module installed



  • 7.  RE: Cannot install PowerCLI

    Posted Jan 19, 2023 10:04 PM

    No Visual Studio installed, nothing in program files or program data and not in control panel.

    Regards,



  • 8.  RE: Cannot install PowerCLI

    Posted Jan 20, 2023 12:10 PM

    Strange.
    Did you try on another station?
    Same result?



  • 9.  RE: Cannot install PowerCLI

    Posted Jan 20, 2023 05:33 PM

    I have tried it on my laptop and it works fine so I ended up doing an offline installation and that worked, thanks for your help tho!