You can get your VMs list, Hyper-V hostname, clustername and csv paths like this: 1 2 3 4 5 6 7 8 9 10 11 $VMs = Get-VM foreach ($VM in $VMs) { $VMName = $VM.Name $VMHostname = $VM.ComputerName $VMHostCluster = (Get-Cluster).Name $VMHardDisk = $VM.ConfigurationLocation $VMHardDiskLocation = $VMHardDisk.Split("\")[2] $Value = $VMName + "," + $VMHostname [...]
↧