Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

Commit

Permalink
Merge pull request #471 from sammcgeown/Fix_Get-NSXSegmentIdRange
Browse files Browse the repository at this point in the history
Fix for get-nsxsegmentidrange
  • Loading branch information
Nick Bradford authored Feb 22, 2018
2 parents a3f35bc + 9f9da50 commit 66444fd
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions module/PowerNSX.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -7616,7 +7616,6 @@ function New-NsxController {
}

# Check for presence of optional controller name
if ($PSBoundParameters.ContainsKey("ControllerName")) {Add-XmlElement -xmlRoot $ControllerSpec -xmlElementName "name" -xmlElementText $ControllerName.ToString()}
if ($PSBoundParameters.ContainsKey("Password") -and ($Ctrlcount.count -eq 0)) {Add-XmlElement -xmlRoot $ControllerSpec -xmlElementName "password" -xmlElementText $Password.ToString()}
Add-XmlElement -xmlRoot $ControllerSpec -xmlElementName "datastoreId" -xmlElementText $DataStore.ExtensionData.Moref.value.ToString()
Add-XmlElement -xmlRoot $ControllerSpec -xmlElementName "networkId" -xmlElementText $PortGroup.ExtensionData.Moref.Value.ToString()
Expand Down Expand Up @@ -8955,11 +8954,13 @@ function Get-NsxSegmentIdRange {

$URI = "/api/2.0/vdn/config/segments"
$response = invoke-nsxrestmethod -method "get" -uri $URI -connection $connection
switch ( $PSCmdlet.ParameterSetName ) {
"Name" { $response.segmentRanges.segmentRange | where-object { $_.name -eq $Name } }
"UniversalOnly" { $response.segmentRanges.segmentRange | where-object { $_.isUniversal -eq "true" } }
"LocalOnly" { $response.segmentRanges.segmentRange | where-object { $_.isUniversal -eq "false" } }
Default { $response.segmentRanges.segmentRange }
if(([bool](($response.segmentRanges).PSobject.Properties.name -match "segmentRange"))){
switch ( $PSCmdlet.ParameterSetName ) {
"Name" { $response.segmentRanges.segmentRange | where-object { $_.name -eq $Name } }
"UniversalOnly" { $response.segmentRanges.segmentRange | where-object { $_.isUniversal -eq "true" } }
"LocalOnly" { $response.segmentRanges.segmentRange | where-object { $_.isUniversal -eq "false" } }
Default { $response.segmentRanges.segmentRange }
}
}
}
}
Expand Down

0 comments on commit 66444fd

Please sign in to comment.