I am currently running the following search-cloud to get Org VDC Network.
$network = Search-Cloud -QueryType OrgVdcNetwork -Name 'my_network_name'
I then want to get the href of this object. But, this is not visible in the object returned:
PS C:\powershell\VCDProduction\GenericScripts> $a
Name : my_network_name
DefaultGateway : 192.168.1.254
Netmask : 255.255.255.0
Dns1 :
Dns2 :
DnsSuffix :
LinkType : 0
ConnectedTo : my_network_name
Vdc : urn:vcloud:vdc:ae96fdb6-b2df-4884-911f-c19e24953b4f
IsBusy : False
IsShared : True
VdcName : my_vdc_name
IsIpScopeInherited : True
Href :
Id : urn:vcloud:network:f55f6db0-e099-45d5-88eb-8192e00e9618
Type :
AnyAttr : {taskStatus, taskOperation, task, taskDetails}
Link :
Metadata :
PropertyList : {[Name, my_network_name], [DefaultGateway, 192.168.1.254],
[Netmask, 255.255.255.0], [Dns1, ]...}
Uid : /CIServer=custdccreator:system@x.x.x.x:443/CISearchResult=18de8709-af31-4c2a-90b7-4596c43457c2
/
Client : /CIServer=custdccreator:system@x.x.x.x:443/
Not a straight-forward approach, but you can try this to solve your problem:
// Search for all OrgVdcNetwork
$s_orgvdcnetwork = Search-Cloud -QueryType OrgVdcNetwork
// Filter the network name you want to match
$q = $s_orgvdcnetwork | Where-Object {$_.Name -match '^network-name$'}
//FInally, use OrgVdcNetwork command to access the Href
Get-OrgVdcNetwork -Name $q.Name | select href
HTH.
Not a straight-forward approach, but you can try this to solve your problem:
// Search for all OrgVdcNetwork
$s_orgvdcnetwork = Search-Cloud -QueryType OrgVdcNetwork
// Filter the network name you want to match
$q = $s_orgvdcnetwork | Where-Object {$_.Name -match '^network-name$'}
//FInally, use OrgVdcNetwork command to access the Href
Get-OrgVdcNetwork -Name $q.Name | select href
HTH.