File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,11 +55,15 @@ function Get-NSLBMonitor {
5555 if ($Name.Count -gt 0 ) {
5656 foreach ($item in $Name ) {
5757 $monitors = _InvokeNSRestApi - Session $Session - Method Get - Type lbmonitor - Action Get - Resource $item
58- return $monitors.lbmonitor
58+ if ($monitors.psobject.properties.name -contains ' lbmonitor' ) {
59+ return $monitors.lbmonitor
60+ }
5961 }
6062 } else {
6163 $monitors = _InvokeNSRestApi - Session $Session - Method Get - Type lbmonitor - Action Get
62- return $monitors.lbmonitor
64+ if ($monitors.psobject.properties.name -contains ' lbmonitor' ) {
65+ return $monitors.lbmonitor
66+ }
6367 }
6468 }
6569}
Original file line number Diff line number Diff line change @@ -56,12 +56,16 @@ function Get-NSLBServer {
5656 foreach ($item in $Name ) {
5757 $response = _InvokeNSRestApi - Session $Session - Method Get - Type server - Resource $item - Action Get
5858 if ($response.errorcode -ne 0 ) { throw $response }
59+ if ($Response.psobject.properties.name -contains ' server' ) {
5960 $response.server
6061 }
62+ }
6163 } else {
6264 $response = _InvokeNSRestApi - Session $Session - Method Get - Type server - Action Get
6365 if ($response.errorcode -ne 0 ) { throw $response }
64- $response.server
66+ if ($Response.psobject.properties.name -contains ' server' ) {
67+ $response.server
68+ }
6569 }
6670 }
6771}
Original file line number Diff line number Diff line change @@ -55,11 +55,15 @@ function Get-NSLBServiceGroup {
5555 if ($Name.Count -gt 0 ) {
5656 foreach ($item in $Name ) {
5757 $serviceGroups = _InvokeNSRestApi - Session $Session - Method Get - Type servicegroup - Action Get - Resource $item
58- return $serviceGroups.servicegroup
58+ if ($ServiceGroups.psobject.properties.name -contains ' servicegroup' ) {
59+ return $serviceGroups.servicegroup
60+ }
5961 }
6062 } else {
6163 $serviceGroups = _InvokeNSRestApi - Session $Session - Method Get - Type servicegroup - Action Get
62- return $serviceGroups.servicegroup
64+ if ($ServiceGroups.psobject.properties.name -contains ' servicegroup' ) {
65+ return $serviceGroups.servicegroup
66+ }
6367 }
6468 }
6569}
You can’t perform that action at this time.
0 commit comments