Open heitmanr opened 7 years ago
@ron4all The markdown examples seem to have gotten minced but I think I understand what you are asking.
The addressGroups
is actually more than just a value; it's the XML parent node which contains the interface address details.
Here are a few examples of how you can further extract:
In the example below, I am testing against a DLR named t-dlr-prod
and inspecting the DLR interface named transit
:
$dlr = Get-NsxLogicalRouter -Name 't-dlr-prod'
$dlr|Get-NsxLogicalRouterInterface -Name 'transit'
($dlr|Get-NsxLogicalRouterInterface -Name 'transit').addressGroups.addressGroup
primaryAddress : 192.168.8.1
subnetMask : 255.255.255.248
subnetPrefixLength : 29
($dlr|Get-NsxLogicalRouterInterface -Name 'transit' | select -ExpandProperty addressGroups | select -ExpandProperty addressGroup)
Thanks for jumping in on this @vScripter - perfect answer - although Ill leave this open to create the missing Get-NsxLogicalRouterIInterfaceAddress cmdlet.
pushing to 2.2 as non critical
PowerCLI C:> Get-NsxLogicalRouter | Get-NsxLogicalRouterInterface -name "T_DLR"
https://192.168.47.200/api/4.0/edges/edge-47/interfaces
or...
is it similar to
Function Get-NsxEdgeInterface PowerNSX Function Get-NsxEdgeInterfaceAddress PowerNSX
that Function Get-NsxLogicalRouterInterface PowerNSX exists but ... the Function "Get-NsxLogicalRouterInterfaceAddress" isn't there!?