View Only
  • 1.  get-vm is not working

    Posted Aug 07, 2018 12:25 PM

    When  I connected to  the vcenter its not showing vms list after executing (get-vm)

    But if  I execute list this Get-VM *

    I can able to list the VMs

  • 2.  RE: get-vm is not working

    Posted Aug 07, 2018 12:29 PM

    Did you already try to stop/start your PowerShell session?

    Do you have multiple vCenters connected?

    Does it do this for all vCenters? Or a specific one?

    Any disconnected, orphaned or otherwise funny VMs in the environment?

  • 3.  RE: get-vm is not working

    Posted Aug 07, 2018 01:19 PM

    Did you already try to stop/start your PowerShell session?


    Do you have multiple vCenters connected?

    No Only Single vCenter

    Does it do this for all vCenters? Or a specific one?

    I didn't tested on multiple vCenters.

    Any disconnected, orphaned or otherwise funny VMs in the environment?

    No Such vM's observed in the environment.

    This time I opened a powercli window and executed (get-vm) but no luck.

    But Get-VM *  can show vm names.

  • 4.  RE: get-vm is not working

    Posted Aug 07, 2018 01:31 PM

    Can you do the following, and post the output?

    Get-Module -Name VMware* -ListAvailable

  • 5.  RE: get-vm is not working

    Posted Aug 07, 2018 01:59 PM

    Please find the output

        Directory: C:\Program Files\WindowsPowerShell\Modules

    ModuleType Version    Name                                ExportedCommands                                                                            

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

    Script VMware.DeployAutomation             {Add-DeployRule, Add-ProxyServer, Add-ScriptBundle, Copy-DeployRule...}                     

    Script VMware.ImageBuilder                 {Add-EsxSoftwareDepot, Add-EsxSoftwarePackage, Compare-EsxImageProfile, Export-EsxImagePro...

    Manifest   10.1.1.... VMware.PowerCLI                                                                                                                 

    Script VMware.Vim                                                                                                                      

    Script     10.1.0.... VMware.VimAutomation.Cis.Core       {Connect-CisServer, Disconnect-CisServer, Get-CisService}                                   

    Binary VMware.VimAutomation.Cis.Core       {Connect-CisServer, Disconnect-CisServer, Get-CisService}                                   

    Script     10.0.0.... VMware.VimAutomation.Cloud          {Add-CIDatastore, Connect-CIServer, Disconnect-CIServer, Get-Catalog...}                    

    Script     10.1.0.... VMware.VimAutomation.Common                                                                                                     

    Manifest VMware.VimAutomation.Common                                                                                                     

    Script     10.1.0.... VMware.VimAutomation.Core           {Add-PassthroughDevice, Add-VirtualSwitchPhysicalNetworkAdapter, Add-VMHost, Add-VMHostNtp...

    Binary VMware.VimAutomation.Core           {Add-PassthroughDevice, Add-VirtualSwitchPhysicalNetworkAdapter, Add-VMHost, Add-VMHostNtp...

    Script VMware.VimAutomation.HA             Get-DrmInfo                                                                                 

    Script VMware.VimAutomation.HorizonView    {Connect-HVServer, Disconnect-HVServer}                                                     

    Script     10.0.0.... VMware.VimAutomation.License        Get-LicenseDataManager                                                                      

    Script     10.1.0.... VMware.VimAutomation.Nsxt           {Connect-NsxtServer, Disconnect-NsxtServer, Get-NsxtService}                                

    Script     10.0.0.... VMware.VimAutomation.PCloud         {Connect-PIServer, Disconnect-PIServer, Get-PIComputeInstance, Get-PIDatacenter}            

    Script     10.1.0.... VMware.VimAutomation.Sdk            {Get-PSVersion, Get-InstallPath}                                                            

    Manifest VMware.VimAutomation.Sdk            {Get-PSVersion, Get-InstallPath}                                                            

    Script     10.0.0.... VMware.VimAutomation.Srm            {Connect-SrmServer, Disconnect-SrmServer}                                                   

    Script     10.1.0.... VMware.VimAutomation.Storage        {Add-KeyManagementServer, Copy-VDisk, Export-SpbmStoragePolicy, Get-KeyManagementServer...} 

    Script    VMware.VimAutomation.StorageUtility Update-VmfsDatastore                                                                        

    Script     10.1.0.... VMware.VimAutomation.Vds            {Add-VDSwitchPhysicalNetworkAdapter, Add-VDSwitchVMHost, Export-VDPortGroup, Export-VDSwit...

    Script     10.0.0.... VMware.VimAutomation.Vmc            {Connect-Vmc, Disconnect-Vmc, Get-VmcService, Connect-VmcServer...}                         

    Script     10.0.0.... VMware.VimAutomation.vROps          {Connect-OMServer, Disconnect-OMServer, Get-OMAlert, Get-OMAlertDefinition...}              

    Script VMware.VumAutomation                {Add-EntityBaseline, Copy-Patch, Get-Baseline, Get-Compliance...}                           

        Directory: C:\Program Files (x86)\VMware\Infrastructure\PowerCLI\Modules

    ModuleType Version    Name                                ExportedCommands                                                                            

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

    Binary    VMware.DeployAutomation                                                                                                         

    Binary    VMware.ImageBuilder                                                                                                             

    Binary VMware.VimAutomation.Cis.Core                                                                                                   

    Binary VMware.VimAutomation.Cloud                                                                                                      

    Manifest VMware.VimAutomation.Common                                                                                                     

    Binary VMware.VimAutomation.Core           HookGetViewAutoCompleter                                                                    

    Binary    VMware.VimAutomation.HA                                                                                                         

    Binary VMware.VimAutomation.HorizonView                                                                                                

    Binary VMware.VimAutomation.License                                                                                                    

    Binary VMware.VimAutomation.PCloud                                                                                                     

    Manifest VMware.VimAutomation.Sdk            Get-PSVersion                                                                               

    Binary VMware.VimAutomation.Storage                                                                                                    

    Binary VMware.VimAutomation.Vds                                                                                                        

    Binary VMware.VimAutomation.vROps                                                                                                      

    Binary    VMware.VumAutomation                                                                                                            

  • 6.  RE: get-vm is not working
    Best Answer

    Posted Aug 07, 2018 03:28 PM

    You seem to have multiple PowerCLI versions installed.

    I would suggest to remove all of them (also the entry you find in the Programs and Features applet).

    Remove all the module folders related to PowerCLI.

    And then do a fresh install with Install-Module.

  • 7.  RE: get-vm is not working

    Posted Aug 21, 2018 07:45 AM

    Thanks now its working.