Hi All,
We have many vm's are renamed. Those vm's are renamed but vmdk still old name.
Need to found those vm's .
Thanks,
Siva
Try something like this.
It compares the VM's Displayname with the folder name of the VM's VMX file.
Get-View -ViewType VirtualMachine |
where{$_.Name -ne $_.Config.Files.vmPathName.Split('.')[0].Split('/')[-2]} |
Select Name
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try something like this.
It compares the VM's Displayname with the folder name of the VM's VMX file.
Get-View -ViewType VirtualMachine |
where{$_.Name -ne $_.Config.Files.vmPathName.Split('.')[0].Split('/')[-2]} |
Select Name
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks Lucd.. Grate
It's worked after Array [-1].
Get-View -ViewType VirtualMachine |where{$_.Name -ne $_.Config.Files.vmPathName.Split('.')[0].Split('/')[-1]} |Select Name