VMware Cloud Community
pt073
Contributor
Contributor
Jump to solution

Get-VM - OSFullName

Hello ,

When I do a  Get-VM - OSFullName it returns "Microsoft Windows Server 2003, Enterprise Edition (32-bit)"

The comma in the text is messing up my SQL bulk insert for reporting, any way to get short OS details?

Thanks

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

There is

Get-VM MyVM | select Name,@{N="GuestId";E={$_.Guest.GuestId}}

The list of guestids can be found in the VirtualMachineGuestOsIdentifier enumeration.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
4 Replies
LucD
Leadership
Leadership
Jump to solution

One way of getting rid of the comma if it bothers you is

Get-VM MyVM | select Name,@{N="OSFullname";E={$_.Guest.OsFullName.Replace(',','')}}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

pt073
Contributor
Contributor
Jump to solution

Thanks I will try that, do you know if theres a short OS detail?

0 Kudos
LucD
Leadership
Leadership
Jump to solution

There is

Get-VM MyVM | select Name,@{N="GuestId";E={$_.Guest.GuestId}}

The list of guestids can be found in the VirtualMachineGuestOsIdentifier enumeration.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
pt073
Contributor
Contributor
Jump to solution

Excellent Thanks!

0 Kudos