cls
Remove-Variable -Name * -Force -ErrorAction SilentlyContinue # remove any lingering variables
Add-PSSnapin VMware.VimAutomation.Core -ErrorAction SilentlyContinue
$vcs = @()
$vcs += connect-viserver visrv1 -User USERNAME -Password PASSWORD
$vcs += connect-viserver visrv2 -User USERNAME -Password PASSWORD
$vcs += connect-viserver visrv3 -User USERNAME -Password PASSWORD
get-vm | % { get-view $_.ID } | select Name, @{ Name="ToolsVersion"; Expression={$_.config.tools.toolsVersion}}
Disconnect-VIServer $vcs
thanks for the short to the point version
ReplyDelete