This commit is contained in:
2022-12-12 18:58:13 +03:00
parent 0742737f0d
commit 9069989af3
11 changed files with 104 additions and 137 deletions

View File

@@ -54,7 +54,7 @@ function Get-Subnet {
}
switch ($PSCmdlet.ParameterSetName) {
"ByCIDR" {
$_identifiers = @("cidr",$CIDR)
$_identifiers = @("cidr",$CIDR); break
}
"ByID" {
$_identifiers = @($Id)
@@ -66,25 +66,29 @@ function Get-Subnet {
$_identifiers += "slaves"
}
}
break
}
"BySectionId" {
$_params.Item("Controller") = "sections"
$_sectionId = $SectionId
$_identifiers = @($_sectionId,"subnets")
$_identifiers = @($_sectionId,"subnets")
break
}
"BySectionName" {
$_params.Item("Controller") = "sections"
$_sectionId = (Get-Section -Name $SectionName).id
if (!$_sectionId) { throw "Cannot find section!" }
$_identifiers = @($_sectionId,"subnets")
$_identifiers = @($_sectionId,"subnets")
break
}
"ByVrfId" {
$_params.Item("Controller") = "vrf"
$_vrfId = $VrfId
$_identifiers = @($_vrfId,"subnets")
break
}
"ByVlanId" {
$_params.Item("Controller") = "vlan"
@@ -95,6 +99,7 @@ function Get-Subnet {
$_identifiers = @($_vlanId,"subnets")
if ($_sectionId) { $_identifiers += $_sectionId }
break
}
"ByVlanNumber" {
$_params.Item("Controller") = "vlan"
@@ -111,6 +116,7 @@ function Get-Subnet {
$_identifiers = @($_vlanId,"subnets")
if ($_sectionId) { $_identifiers += $_sectionId }
break
}
}
$_params.Add("Identifiers",$_identifiers)