bottkars / vmxtoolkit

vmxtoolkit is the Powershell extension to VMware Workstation
Apache License 2.0
116 stars 32 forks source link

The DisplayName is faulty #21

Open BigAlUK99 opened 5 years ago

BigAlUK99 commented 5 years ago

When trying to extract the DisplayName for a VM (Get-VMXDisplayName), the trailing characters after any whitespace are all that is returned. For example, if the VM display name is 'MS-DOS 3.3' then just the '3.3' part is returned.

[Using VMXToolkit 4.5.3 on VMware 12.5.9 under Powershell 5.1 on Windows 7 host]

BigAlUK99 commented 5 years ago

Incidentally, using the following when the VM is running does work: $Text = & $vmrun readVariable "C:\Users\alex\Documents\Virtual Machines\MS-DOS 3.3\MS-DOS 3.3.vmx" runtimeConfig displayname. So it is not as if the given DisplayName is inherently problematic and thus causing the problem.

BigAlUK99 commented 5 years ago

In fact my current (very cumbersome) workaround is the horrendous: foreach ($VM in get-vmx) {($VM | get-vmxconfig | Where-Object {$_.startswith('displayname = ',"CurrentCultureIgnoreCase")}).split('=')[1].trim(' "')} which may help in identifying a potential correction to the VMXToolkit. :)

SinOfNature commented 3 years ago

Confirmed. Any names with spaces in them simply returns the last 'word'. A name of "Ubuntu 20.04" simply returns "20.04".

VMXToolkit 4.5.3 , Win 10, Powershell 5