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

@@ -41,10 +41,10 @@ function Get-Permissions {
Method = "GET"
}
switch ($PSCmdlet.ParameterSetName) {
"ByID" { $_identifiers = @($id) }
"ByIP" { $_identifiers = ("search",$IP) }
"ByHostName" { $_identifiers = ("search_hostname",$HostName) }
"ByTag" { $_identifiers = ("tags",$TagId,"addresses") }
"ByID" { $_identifiers = @($id); break }
"ByIP" { $_identifiers = ("search",$IP); break }
"ByHostName" { $_identifiers = ("search_hostname",$HostName); break }
"ByTag" { $_identifiers = ("tags",$TagId,"addresses"); break }
"BySubnetId" {
if ($IP) {
$_identifiers = ($IP,$SubnetId)
@@ -52,6 +52,7 @@ function Get-Permissions {
$_params.Item("Controller") = "subnets"
$_identifiers = ($SubnetId,"addresses")
}
break
}
"BySubnetCIDR" {
$_params.Item("Controller") = "subnets"
@@ -59,6 +60,7 @@ function Get-Permissions {
if (!$_subnetId) { throw "Cannot find subnet!" }
$_identifiers = ($_subnetId,"addresses")
break
}
}
$_params.Add("Identifiers",$_identifiers)