Is it possible to get a list of vm's and their vmdk's and find the ones that have duplicate UUID's?
Thanks
To get the list you can do
Get-HardDisk |
Select @{N = 'VM'; E = { $vm.Name } }, Filename,
@{N = 'UUID'; E = { $_.ExtensionData.Backing.Uuid } }
To find the HD with duplicate UUIDs, you could do
Get-HardDisk |
Select @{N = 'VM'; E = { $vm.Name } }, Filename,
@{N = 'UUID'; E = { $_.ExtensionData.Backing.Uuid } } |
Group-Object -Property Uuid |
where { $_.Count -gt 1 } |
Select Name, @{N = 'VMs'; E = { $_.Group.VM -join '|' } }
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
To get the list you can do
Get-HardDisk |
Select @{N = 'VM'; E = { $vm.Name } }, Filename,
@{N = 'UUID'; E = { $_.ExtensionData.Backing.Uuid } }
To find the HD with duplicate UUIDs, you could do
Get-HardDisk |
Select @{N = 'VM'; E = { $vm.Name } }, Filename,
@{N = 'UUID'; E = { $_.ExtensionData.Backing.Uuid } } |
Group-Object -Property Uuid |
where { $_.Count -gt 1 } |
Select Name, @{N = 'VMs'; E = { $_.Group.VM -join '|' } }
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I put the ft -autosize but it still truncates the list with ...
How do you set the output to not truncate?
Doing an out-file results in the same thing.
Putting the below gave something more readable...
out-string -Width 1600
Thanks
You can also display it as a list with Format-List.
Or export it to a file.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference