Hi,
I am not able to get the cluster name from the below script, please help
Get-VMHost | Get-VirtualPortGroup -Name "VM Network 3011" | select @{N='Cluster';E={get-cluster -Name $_}}, @{N='VMHost';E={get-vmhost -id $_.VMhostid}}, @{N='PortGroup_Name';E={$_.Name}}, VirtualSwitch, VLanID
Try like this.
It requires PS v4 or higher.
select @{N='Cluster';E={(Get-Cluster -VMHost $esx).Name}},
@{N='VMHost';E={$esx.Name}},
@{N='PortGroup_Name';E={$_.Name}},
VirtualSwitch, VLanID
---------------------------------------------------------------------------------------------------------
Was it helpful? Let us know by completing this short survey here.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try like this.
It requires PS v4 or higher.
select @{N='Cluster';E={(Get-Cluster -VMHost $esx).Name}},
@{N='VMHost';E={$esx.Name}},
@{N='PortGroup_Name';E={$_.Name}},
VirtualSwitch, VLanID
---------------------------------------------------------------------------------------------------------
Was it helpful? Let us know by completing this short survey here.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
That was quick, Thank you very much