List all VMs and their current VMX Location
Connect-VIServer MYVISERVER
$Information = @()
Foreach ($VM in (Get-VM | Sort Name | Get-View)){
$MyDetails = "" | Select-Object VMName,VMXLocation
$MyDetails.VMName = $VM.Name
$MyDetails.VMXLocation = $VM.Config.Files.VmPathName
$Information += $MyDetails
}
$Information
- Scott March
Sunday, August 15, 2010
Subscribe to:
Post Comments (Atom)
1 comments:
Hi,
i have added a custom attribut to vCenter, how cal I include that info?
I tried adding get-annotation -customattribute "class" but not sure how to incorporate it
Post a Comment