When name of the VM is a long, use get-vm command to get VM name that show ... after VM name.
I want to show full name of VM, What should I do?
Hi as900w
Check How do I get Virtual Machine Name Output from 'Get-VM | Get-AdvancedSetting' command?
Hi as900w
Check How do I get Virtual Machine Name Output from 'Get-VM | Get-AdvancedSetting' command?
Hi,
This will do it for you:
Get-VM | ft -AutoSize
Moderator: Moved to PowerCLI
get-vm |%{ $_|Select Name,@{N="OriginalName";E={(($_ | Get-AdvancedSetting |Where{$_.Name -eq 'nvram'} ).value).Split('.')[0]}}, VMHost,PowerState }
The above snippet should work, in case where the VM has been renamed after deployment. In such case the 'Name' attribute obtained from get-vm cmdlet will be misleading, hence the above should be close to name used during original deployment.