VMware Cloud Community
MRoushdy
Hot Shot
Hot Shot
Jump to solution

get-template guestOS

I'd like to get the GuestOS of a template.

One more, how could I learn about the "library", or reference of "ExtensionData.xx"?

Thank you,

vEXPERT - VCAP-DCV - Blog: arabitnetwork.com | YouTube: youtube.com/c/MohamedRoushdy
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Since a template normally doesn't hold the information obtained by the VMware Tools, you can only discover the configured guest OS.

Like this

Get-Template |

Select-Object Name,

   @{N = 'OSConfigured'; E = { $_.ExtensionData.Config.GuestId } }

The ExtensionData maps the information contained in the vSphere objects.

These are documented in the VMware vSphere API Reference Documentation

There is a VMware vSphere Web Services SDK Programming Guide but that one is not really geared towards PowerCLI users.

There is a chapter on the use of the API in the PowerCLI Reference.


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

View solution in original post

0 Kudos
4 Replies
LucD
Leadership
Leadership
Jump to solution

Since a template normally doesn't hold the information obtained by the VMware Tools, you can only discover the configured guest OS.

Like this

Get-Template |

Select-Object Name,

   @{N = 'OSConfigured'; E = { $_.ExtensionData.Config.GuestId } }

The ExtensionData maps the information contained in the vSphere objects.

These are documented in the VMware vSphere API Reference Documentation

There is a VMware vSphere Web Services SDK Programming Guide but that one is not really geared towards PowerCLI users.

There is a chapter on the use of the API in the PowerCLI Reference.


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

0 Kudos
trevez
Contributor
Contributor
Jump to solution

Hey

This needs updating to get correct info- use :

Get-Template |Select-Object Name,@{N = 'OSConfigured'; E = { $_.ExtensionData.config.GuestFullName} }

0 Kudos
LucD
Leadership
Leadership
Jump to solution

I suspect you missed the 1st line of my reply "Since a template normally doesn't hold the information obtained by the VMware Tools, you can only discover the configured guest OS"

If the VM on which the template is based never had a chance to run the VMware Tools or the data obtained by the VMware Tools has expired, the GuestFullName property will be empty.


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

0 Kudos
trevez
Contributor
Contributor
Jump to solution

nope didnt miss it- just wanted to post what worked for me.

Now others trying to find this info will have alternate options to get OS info either way. Go team 🙂

0 Kudos