List all VMs and their current VMX Location

# 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

Comments

Popular posts from this blog

esxi-host-shows-disconnected-vmware

ESXi : Lost uplink redundancy on virtual switch "vSwitch0". Physical NIC vmnic0 is down

Virtual machines appear as invalid or orphaned in vCenter Server