VMware {code}

 View Only
  • 1.  PowerCLI Module for PowerShell not working

    Posted Jul 06, 2018 06:08 PM

    I have installed the powercli module in powershell using "install-module -name vmware.powercli"; Version 10.1.1.8827524 along with all the modules:

    Version        Name
    -------        ----
    6.7.0.8250345  VMware.DeployAutomation
    6.7.0.8250345  VMware.ImageBuilder
    10.1.1.8827524 VMware.PowerCLI
    6.7.0.8343295  VMware.Vim
    10.1.0.8377811 VMware.VimAutomation.Cis.Core
    10.0.0.7893901 VMware.VimAutomation.Cloud
    10.1.0.8342134 VMware.VimAutomation.Common
    10.1.0.8344055 VMware.VimAutomation.Core
    6.5.4.7567193  VMware.VimAutomation.HA
    7.5.0.8827468  VMware.VimAutomation.HorizonView
    10.0.0.7893904 VMware.VimAutomation.License
    10.1.0.8346947 VMware.VimAutomation.Nsxt
    10.0.0.7893924 VMware.VimAutomation.PCloud
    10.1.0.8342078 VMware.VimAutomation.Sdk
    10.0.0.7893900 VMware.VimAutomation.Srm
    10.1.0.8313015 VMware.VimAutomation.Storage
    1.2.0.0        VMware.VimAutomation.StorageUtility
    10.1.0.8344219 VMware.VimAutomation.Vds
    10.0.0.7893902 VMware.VimAutomation.Vmc
    10.0.0.7893921 VMware.VimAutomation.vROps
    6.5.1.7862888  VMware.VumAutomation

    When I try to use connect-viserver i get this error:

    PS C:\Users\dbrame> connect-viserver 192.168.11.71
    connect-viserver : The 'connect-viserver' command was found in the module 'VMware.VimAutomation.Core', but the module
    could not be loaded. For more information, run 'Import-Module VMware.VimAutomation.Core'.
    At line:1 char:1
    + connect-viserver 192.168.11.71
    + ~~~~~~~~~~~~~~~~
        + CategoryInfo          : ObjectNotFound: (connect-viserver:String) [], CommandNotFoundException
        + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule

    anyone have an idea of what the issue could be.

    This isn't the only command that is not working, but its the main one I need to work. This is on a Windows 10 machine with the latest version of PowerShell. Funny thing is that VMware.PowerCLI module works with PowerShell Core, but not Powershell.



  • 2.  Re: PowerCLI Module for PowerShell not working

    Posted Jul 10, 2018 05:07 PM

    I should also note that when I run 'import-module vmware.vimautomation.core' it errors out saying that vmware.vimautomation.sdk.(something else here here that I do not remember).

    I import vmware.vimautomation.sdk it seems like it installs, and then vmware.vimautomation.core import seems to work as well. get-module -listavailable  vm* shows all the correct modules. when trying connect-viserver now it shows that its not a recognized command. connect-viserver used to be in powershell-ise but it is not listed anymore.



  • 3.  Re: PowerCLI Module for PowerShell not working

    Posted Nov 25, 2018 02:27 AM

    I am having the same problem when I run Connect-VIServer command and I get the same error as yours.

    I have Already Install the Modules using this command in C:\Modules\:

    Install-Module -Name VMware.PowerCLI

    When I try to import one of the module where I am getting error:

    PS C:\Modules> Import-Module .\VMware.VimAutomation.Core\

    This is where I have the Modules:

    For now I am using Powershell 6.1.1 Core from GitHub - PowerShell/PowerShell: PowerShell for every system!  This seems to work fine though without any modules.



  • 4.  Re: PowerCLI Module for PowerShell not working

    Posted Dec 21, 2018 03:01 PM

    Have you been able to find a solution? I'm having this same problem on a fresh install of windows.



  • 5.  Re: PowerCLI Module for PowerShell not working

    Posted Aug 13, 2019 05:00 AM

    If anyone is still running into this issue, try running "Set-ExecutionPolicy Unrestricted" from an elevated prompt. This should allow the modules to work properly.