VMware Cloud Community
as900w
Hot Shot
Hot Shot
Jump to solution

Get full name of VM using Get-VM command

When name of the VM is a long, use get-vm command to get VM name that show ... after VM name.

1.PNG

I want to show full name of VM, What should I do?

1 Solution

Accepted Solutions
asajm
Expert
Expert
Jump to solution

Hi as900w

Check How do I get Virtual Machine Name Output from 'Get-VM | Get-AdvancedSetting' command?

If you think your queries have been answered
Marking this response as "Solution " or "Kudo"
ASAJM

View solution in original post

0 Kudos
4 Replies
asajm
Expert
Expert
Jump to solution

Hi as900w

Check How do I get Virtual Machine Name Output from 'Get-VM | Get-AdvancedSetting' command?

If you think your queries have been answered
Marking this response as "Solution " or "Kudo"
ASAJM
0 Kudos
RoderikdeBlock
Enthusiast
Enthusiast
Jump to solution

Hi,    

This will do it for you:

Get-VM | ft -AutoSize

Roderik de Block


Blog: https://roderikdeblock.com
scott28tt
VMware Employee
VMware Employee
Jump to solution

Moderator: Moved to PowerCLI


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
0 Kudos
Lewa5VCP
Contributor
Contributor
Jump to solution

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.

0 Kudos