locked
Get-VM | vSphere Web RRS feed

  • Question

  • Hi,

    What Get-VM cmdlet should I use if we are using web vSphere? We just upgarded our vmware and now using web vsphere. It seems Get-VM cmdlet is not recognized already for this one.

    Here's the code:

    if (( Get-PSSnapin Vmware.Vimautomation.core -ErrorAction SilentlyContinue |Out-Null ) -eq $null) {
        Add-PSSnapin vmware.vimautomation.core -ErrorAction SilentlyContinue | Out-Null
        
    }
    Set-PowerCLIConfiguration -DefaultVIServerMode multiple -DisplayDeprecationWarnings:$false -Confirm:$false | Out-Null
    Connect-VIserver -Server $vcenters -credential $cred -ErrorAction SilentlyContinue| Out-Null
    foreach($VM in $servers){
    $vminfo =  Get-VM -name $VM -erroraction silentlycontinue

    Friday, April 12, 2019 12:30 AM

Answers

All replies

  • You will need to post VMWare questions to the vendors VMWare forum.

    https://communities.vmware.com/community/vmtn/vsphere


    \_(ツ)_/

    • Marked as answer by jrv Friday, April 12, 2019 6:58 AM
    Friday, April 12, 2019 12:38 AM
  • thanks
    Friday, April 12, 2019 12:48 AM
  • You ar enot giving the server attribute in

    $vminfo =  Get-VM -name $VM -erroraction silentlycontinue

    should be modified as

    Get-VM $VMMachineName -Server $VMServerName


    sekhar

    Friday, April 12, 2019 6:51 AM
  • You ar enot giving the server attribute in

    $vminfo =  Get-VM -name $VM -erroraction silentlycontinue

    should be modified as

    Get-VM $VMMachineName -Server $VMServerName


    sekhar

    That has nothing to do with the issue asked about.

    The code used is very old and does not work with the current VMWare modules.  The correct place for this question is with the VMWare forum.


    \_(ツ)_/


    • Edited by jrv Friday, April 12, 2019 6:58 AM
    Friday, April 12, 2019 6:56 AM