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
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
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
Thank you very much...that worked 🙂