VMware Cloud Community
ganapa2000
Hot Shot
Hot Shot
Jump to solution

Getting Blank Template PortGroup Details

Hi,

I am unable to get the template portgroup details as it shows blank. Please help.

Get-Template | Select @{N="Folder_Name";E={(Get-View -Id $_.ExtensionData.Parent -Property Name).Name}},
@{N="Host";E={(Get-VMhost -id $_.HostID).Name}},
@{N="Template_Name";E={$_.Name}},
@{N="Port Group"; E={(Get-VirtualPortGroup -vm $_.Name)}} ft -auto

 

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

A Template is not a VM (for the Get-VirtualPortgroup cmdlet).
You have to use the EXtensionData

Get-Template |
Select-Object @{N = "Folder_Name"; E = { (Get-View -Id $_.ExtensionData.Parent -Property Name).Name } },
@{N = "Host"; E = { (Get-VMHost -Id $_.HostID).Name } },
@{N = "Template_Name"; E = { $_.Name } },
@{N = "Port Group"; E = { (Get-view -Id $_.ExtensionData.Network).Name } } |
ft -auto


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

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

A Template is not a VM (for the Get-VirtualPortgroup cmdlet).
You have to use the EXtensionData

Get-Template |
Select-Object @{N = "Folder_Name"; E = { (Get-View -Id $_.ExtensionData.Parent -Property Name).Name } },
@{N = "Host"; E = { (Get-VMHost -Id $_.HostID).Name } },
@{N = "Template_Name"; E = { $_.Name } },
@{N = "Port Group"; E = { (Get-view -Id $_.ExtensionData.Network).Name } } |
ft -auto


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

0 Kudos
ganapa2000
Hot Shot
Hot Shot
Jump to solution

Thank you very much...that worked 🙂

0 Kudos