Fixes
This commit is contained in:
33
functions/public/Assign-Tag.ps1
Normal file
33
functions/public/Assign-Tag.ps1
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
function Assign-Tag {
|
||||||
|
[CmdletBinding()]
|
||||||
|
param (
|
||||||
|
[parameter(Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true,Position=0)]
|
||||||
|
[ValidateNotNullOrEmpty()]
|
||||||
|
[PS.IPAM.Address]
|
||||||
|
$AddressObject,
|
||||||
|
[parameter(Mandatory=$true,Position=1)]
|
||||||
|
[ValidateNotNullOrEmpty()]
|
||||||
|
[PS.IPAM.Tag]
|
||||||
|
$Tag
|
||||||
|
)
|
||||||
|
process {
|
||||||
|
$_params = @{
|
||||||
|
Controller = [PS.IPAM.controllers]::addresses
|
||||||
|
Method = "PATCH"
|
||||||
|
}
|
||||||
|
$_id = $AddressObject.id
|
||||||
|
$_tagid = $Tag.id
|
||||||
|
|
||||||
|
$_identifiers = @($_id)
|
||||||
|
|
||||||
|
$_params.Add("Identifiers",$_identifiers)
|
||||||
|
|
||||||
|
$_body = @{ }
|
||||||
|
$_body.Add("tag", $_tagid)
|
||||||
|
|
||||||
|
$_params.Add("Params",$_body)
|
||||||
|
|
||||||
|
Invoke-Request @_params
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Export-ModuleMember -Function Assign-Tag
|
||||||
@@ -36,10 +36,10 @@ function Get-Address {
|
|||||||
Type = [PS.IPAM.types]::address
|
Type = [PS.IPAM.types]::address
|
||||||
}
|
}
|
||||||
switch ($PSCmdlet.ParameterSetName) {
|
switch ($PSCmdlet.ParameterSetName) {
|
||||||
"ByID" { $_identifiers = @($id) }
|
"ByID" { $_identifiers = @($id); break }
|
||||||
"ByIP" { $_identifiers = ("search",$IP) }
|
"ByIP" { $_identifiers = ("search",$IP); break }
|
||||||
"ByHostName" { $_identifiers = ("search_hostname",$HostName) }
|
"ByHostName" { $_identifiers = ("search_hostname",$HostName); break }
|
||||||
"ByTag" { $_identifiers = ("tags",$TagId,[PS.IPAM.controllers]::addresses) }
|
"ByTag" { $_identifiers = ("tags",$TagId,[PS.IPAM.controllers]::addresses); break }
|
||||||
"BySubnetId" {
|
"BySubnetId" {
|
||||||
if ($IP) {
|
if ($IP) {
|
||||||
$_identifiers = ($IP,$SubnetId)
|
$_identifiers = ($IP,$SubnetId)
|
||||||
@@ -47,6 +47,7 @@ function Get-Address {
|
|||||||
$_params.Item("Controller") = [PS.IPAM.controllers]::subnets
|
$_params.Item("Controller") = [PS.IPAM.controllers]::subnets
|
||||||
$_identifiers = ($SubnetId,[PS.IPAM.controllers]::addresses)
|
$_identifiers = ($SubnetId,[PS.IPAM.controllers]::addresses)
|
||||||
}
|
}
|
||||||
|
break
|
||||||
}
|
}
|
||||||
"BySubnetCIDR" {
|
"BySubnetCIDR" {
|
||||||
$_params.Item("Controller") = [PS.IPAM.controllers]::subnets
|
$_params.Item("Controller") = [PS.IPAM.controllers]::subnets
|
||||||
@@ -54,6 +55,7 @@ function Get-Address {
|
|||||||
if (!$_subnetId) { throw "Cannot find subnet!" }
|
if (!$_subnetId) { throw "Cannot find subnet!" }
|
||||||
|
|
||||||
$_identifiers = ($_subnetId,[PS.IPAM.controllers]::addresses)
|
$_identifiers = ($_subnetId,[PS.IPAM.controllers]::addresses)
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$_params.Add("Identifiers",$_identifiers)
|
$_params.Add("Identifiers",$_identifiers)
|
||||||
|
|||||||
@@ -11,12 +11,12 @@ function Get-Nameserver {
|
|||||||
$visibleProperties = [System.Management.Automation.PSPropertySet]::new('DefaultDisplayPropertySet',$visiblePropertiesList)
|
$visibleProperties = [System.Management.Automation.PSPropertySet]::new('DefaultDisplayPropertySet',$visiblePropertiesList)
|
||||||
|
|
||||||
$_params = @{
|
$_params = @{
|
||||||
Controller = "tools"
|
Controller = [PS.IPAM.controllers]::tools
|
||||||
SubController = "nameservers"
|
SubController = [PS.IPAM.subcontrollers]::nameservers
|
||||||
Method = "GET"
|
Method = "GET"
|
||||||
}
|
}
|
||||||
switch ($PSCmdlet.ParameterSetName) {
|
switch ($PSCmdlet.ParameterSetName) {
|
||||||
"ByID" { $_nameserverId = $Id }
|
"ByID" { $_nameserverId = $Id; break }
|
||||||
}
|
}
|
||||||
$_identifiers = @($_nameserverId)
|
$_identifiers = @($_nameserverId)
|
||||||
$_params.Add("Identifiers",$_identifiers)
|
$_params.Add("Identifiers",$_identifiers)
|
||||||
|
|||||||
@@ -41,10 +41,10 @@ function Get-Permissions {
|
|||||||
Method = "GET"
|
Method = "GET"
|
||||||
}
|
}
|
||||||
switch ($PSCmdlet.ParameterSetName) {
|
switch ($PSCmdlet.ParameterSetName) {
|
||||||
"ByID" { $_identifiers = @($id) }
|
"ByID" { $_identifiers = @($id); break }
|
||||||
"ByIP" { $_identifiers = ("search",$IP) }
|
"ByIP" { $_identifiers = ("search",$IP); break }
|
||||||
"ByHostName" { $_identifiers = ("search_hostname",$HostName) }
|
"ByHostName" { $_identifiers = ("search_hostname",$HostName); break }
|
||||||
"ByTag" { $_identifiers = ("tags",$TagId,"addresses") }
|
"ByTag" { $_identifiers = ("tags",$TagId,"addresses"); break }
|
||||||
"BySubnetId" {
|
"BySubnetId" {
|
||||||
if ($IP) {
|
if ($IP) {
|
||||||
$_identifiers = ($IP,$SubnetId)
|
$_identifiers = ($IP,$SubnetId)
|
||||||
@@ -52,6 +52,7 @@ function Get-Permissions {
|
|||||||
$_params.Item("Controller") = "subnets"
|
$_params.Item("Controller") = "subnets"
|
||||||
$_identifiers = ($SubnetId,"addresses")
|
$_identifiers = ($SubnetId,"addresses")
|
||||||
}
|
}
|
||||||
|
break
|
||||||
}
|
}
|
||||||
"BySubnetCIDR" {
|
"BySubnetCIDR" {
|
||||||
$_params.Item("Controller") = "subnets"
|
$_params.Item("Controller") = "subnets"
|
||||||
@@ -59,6 +60,7 @@ function Get-Permissions {
|
|||||||
if (!$_subnetId) { throw "Cannot find subnet!" }
|
if (!$_subnetId) { throw "Cannot find subnet!" }
|
||||||
|
|
||||||
$_identifiers = ($_subnetId,"addresses")
|
$_identifiers = ($_subnetId,"addresses")
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$_params.Add("Identifiers",$_identifiers)
|
$_params.Add("Identifiers",$_identifiers)
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ function Get-Section {
|
|||||||
Type = [PS.IPAM.types]::Section
|
Type = [PS.IPAM.types]::Section
|
||||||
}
|
}
|
||||||
switch ($PSCmdlet.ParameterSetName) {
|
switch ($PSCmdlet.ParameterSetName) {
|
||||||
"ByID" { $_identifiers = @($Id) }
|
"ByID" { $_identifiers = @($Id); break }
|
||||||
"ByName" { $_identifiers = @($Name) }
|
"ByName" { $_identifiers = @($Name); break }
|
||||||
}
|
}
|
||||||
$_params.Add("Identifiers",$_identifiers)
|
$_params.Add("Identifiers",$_identifiers)
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ function Get-Subnet {
|
|||||||
}
|
}
|
||||||
switch ($PSCmdlet.ParameterSetName) {
|
switch ($PSCmdlet.ParameterSetName) {
|
||||||
"ByCIDR" {
|
"ByCIDR" {
|
||||||
$_identifiers = @("cidr",$CIDR)
|
$_identifiers = @("cidr",$CIDR); break
|
||||||
}
|
}
|
||||||
"ByID" {
|
"ByID" {
|
||||||
$_identifiers = @($Id)
|
$_identifiers = @($Id)
|
||||||
@@ -66,25 +66,29 @@ function Get-Subnet {
|
|||||||
$_identifiers += "slaves"
|
$_identifiers += "slaves"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
break
|
||||||
}
|
}
|
||||||
"BySectionId" {
|
"BySectionId" {
|
||||||
$_params.Item("Controller") = "sections"
|
$_params.Item("Controller") = "sections"
|
||||||
$_sectionId = $SectionId
|
$_sectionId = $SectionId
|
||||||
|
|
||||||
$_identifiers = @($_sectionId,"subnets")
|
$_identifiers = @($_sectionId,"subnets")
|
||||||
|
break
|
||||||
}
|
}
|
||||||
"BySectionName" {
|
"BySectionName" {
|
||||||
$_params.Item("Controller") = "sections"
|
$_params.Item("Controller") = "sections"
|
||||||
$_sectionId = (Get-Section -Name $SectionName).id
|
$_sectionId = (Get-Section -Name $SectionName).id
|
||||||
if (!$_sectionId) { throw "Cannot find section!" }
|
if (!$_sectionId) { throw "Cannot find section!" }
|
||||||
|
|
||||||
$_identifiers = @($_sectionId,"subnets")
|
$_identifiers = @($_sectionId,"subnets")
|
||||||
|
break
|
||||||
}
|
}
|
||||||
"ByVrfId" {
|
"ByVrfId" {
|
||||||
$_params.Item("Controller") = "vrf"
|
$_params.Item("Controller") = "vrf"
|
||||||
$_vrfId = $VrfId
|
$_vrfId = $VrfId
|
||||||
|
|
||||||
$_identifiers = @($_vrfId,"subnets")
|
$_identifiers = @($_vrfId,"subnets")
|
||||||
|
break
|
||||||
}
|
}
|
||||||
"ByVlanId" {
|
"ByVlanId" {
|
||||||
$_params.Item("Controller") = "vlan"
|
$_params.Item("Controller") = "vlan"
|
||||||
@@ -95,6 +99,7 @@ function Get-Subnet {
|
|||||||
$_identifiers = @($_vlanId,"subnets")
|
$_identifiers = @($_vlanId,"subnets")
|
||||||
|
|
||||||
if ($_sectionId) { $_identifiers += $_sectionId }
|
if ($_sectionId) { $_identifiers += $_sectionId }
|
||||||
|
break
|
||||||
}
|
}
|
||||||
"ByVlanNumber" {
|
"ByVlanNumber" {
|
||||||
$_params.Item("Controller") = "vlan"
|
$_params.Item("Controller") = "vlan"
|
||||||
@@ -111,6 +116,7 @@ function Get-Subnet {
|
|||||||
$_identifiers = @($_vlanId,"subnets")
|
$_identifiers = @($_vlanId,"subnets")
|
||||||
|
|
||||||
if ($_sectionId) { $_identifiers += $_sectionId }
|
if ($_sectionId) { $_identifiers += $_sectionId }
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$_params.Add("Identifiers",$_identifiers)
|
$_params.Add("Identifiers",$_identifiers)
|
||||||
|
|||||||
@@ -21,8 +21,9 @@ function Get-SubnetUsage {
|
|||||||
"ByCIDR" {
|
"ByCIDR" {
|
||||||
$_subnetId = (Get-Subnet -CIDR $CIDR).id
|
$_subnetId = (Get-Subnet -CIDR $CIDR).id
|
||||||
if (!$_subnetId) { throw "Cannot find subnet!" }
|
if (!$_subnetId) { throw "Cannot find subnet!" }
|
||||||
|
break
|
||||||
}
|
}
|
||||||
"ByID" { $_subnetId = $Id }
|
"ByID" { $_subnetId = $Id; break }
|
||||||
}
|
}
|
||||||
$_identifiers = @($_subnetId,"usage")
|
$_identifiers = @($_subnetId,"usage")
|
||||||
$_params.Add("Identifiers",$_identifiers)
|
$_params.Add("Identifiers",$_identifiers)
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ function Get-Tag {
|
|||||||
} else {
|
} else {
|
||||||
return $null
|
return $null
|
||||||
}
|
}
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$_params.Add("Identifiers",$_identifiers)
|
$_params.Add("Identifiers",$_identifiers)
|
||||||
|
|||||||
@@ -11,146 +11,68 @@ function New-Subnet {
|
|||||||
[ValidateNotNullOrEmpty()]
|
[ValidateNotNullOrEmpty()]
|
||||||
[string]
|
[string]
|
||||||
$CIDR,
|
$CIDR,
|
||||||
[parameter(
|
[parameter(Mandatory=$true,HelpMessage="Section identifier",Position=1)]
|
||||||
Mandatory=$true,
|
[ValidateNotNullOrEmpty()]
|
||||||
ValueFromPipeline=$true,
|
[int]
|
||||||
ValueFromPipelineByPropertyName=$true,
|
$SectionId,
|
||||||
HelpMessage="Section identifier",
|
[parameter(Mandatory=$false,HelpMessage="Subnet description",Position=2)]
|
||||||
Position=1)]
|
|
||||||
[ValidateScript({ $_ -match "^\d+$" })]
|
|
||||||
[ValidateNotNullOrEmpty()]
|
[ValidateNotNullOrEmpty()]
|
||||||
[string]
|
[string]
|
||||||
$SectionId,
|
|
||||||
[parameter(
|
|
||||||
Mandatory=$false,
|
|
||||||
ValueFromPipeline=$true,
|
|
||||||
ValueFromPipelineByPropertyName=$true,
|
|
||||||
HelpMessage="Subnet description",
|
|
||||||
Position=2)]
|
|
||||||
[string]
|
|
||||||
$Description,
|
$Description,
|
||||||
[parameter(
|
[parameter(Mandatory=$false,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true,HelpMessage="Assigns subnet to VLAN",Position=3)]
|
||||||
Mandatory=$false,
|
[ValidateNotNullOrEmpty()]
|
||||||
ValueFromPipeline=$true,
|
[int]
|
||||||
ValueFromPipelineByPropertyName=$true,
|
|
||||||
HelpMessage="Assigns subnet to VLAN",
|
|
||||||
Position=3)]
|
|
||||||
[ValidateScript({ $_ -match "^\d+$" })]
|
|
||||||
[string]
|
|
||||||
$VlanId,
|
$VlanId,
|
||||||
[parameter(
|
[parameter(Mandatory=$false,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true,HelpMessage="Assigns subnet to VRF",Position=4)]
|
||||||
Mandatory=$false,
|
[ValidateNotNullOrEmpty()]
|
||||||
ValueFromPipeline=$true,
|
[int]
|
||||||
ValueFromPipelineByPropertyName=$true,
|
|
||||||
HelpMessage="Assigns subnet to VRF",
|
|
||||||
Position=4)]
|
|
||||||
[ValidateScript({ $_ -match "^\d+$" })]
|
|
||||||
[string]
|
|
||||||
$VrfId,
|
$VrfId,
|
||||||
[parameter(
|
[parameter(Mandatory=$false,HelpMessage="Master subnet id for nested subnet",Position=5)]
|
||||||
Mandatory=$false,
|
[ValidateNotNullOrEmpty()]
|
||||||
ValueFromPipeline=$true,
|
[int]
|
||||||
ValueFromPipelineByPropertyName=$true,
|
|
||||||
HelpMessage="Master subnet id for nested subnet",
|
|
||||||
Position=5)]
|
|
||||||
[ValidateScript({ $_ -match "^\d+$" })]
|
|
||||||
[string]
|
|
||||||
$MasterSubnetId,
|
$MasterSubnetId,
|
||||||
[parameter(
|
[parameter(Mandatory=$false,HelpMessage="Id of nameserver to attach to subnet",Position=6)]
|
||||||
Mandatory=$false,
|
[ValidateNotNullOrEmpty()]
|
||||||
ValueFromPipeline=$true,
|
[int]
|
||||||
ValueFromPipelineByPropertyName=$true,
|
|
||||||
HelpMessage="Id of nameserver to attach to subnet",
|
|
||||||
Position=6)]
|
|
||||||
[ValidateScript({ $_ -match "^\d+$" })]
|
|
||||||
[string]
|
|
||||||
$NameserverId,
|
$NameserverId,
|
||||||
[parameter(
|
[parameter(Mandatory=$false,HelpMessage="Controls weather subnet is displayed as IP address or Name in subnets menu",Position=7)]
|
||||||
Mandatory=$false,
|
|
||||||
ValueFromPipeline=$true,
|
|
||||||
ValueFromPipelineByPropertyName=$true,
|
|
||||||
HelpMessage="Controls weather subnet is displayed as IP address or Name in subnets menu",
|
|
||||||
Position=7)]
|
|
||||||
[switch]
|
[switch]
|
||||||
$ShowName,
|
$ShowName,
|
||||||
[parameter(
|
[parameter(Mandatory=$false,HelpMessage="Controls if PTR records should be created for subnet",Position=8)]
|
||||||
Mandatory=$false,
|
|
||||||
ValueFromPipeline=$true,
|
|
||||||
ValueFromPipelineByPropertyName=$true,
|
|
||||||
HelpMessage="Controls if PTR records should be created for subnet",
|
|
||||||
Position=8)]
|
|
||||||
[switch]
|
[switch]
|
||||||
$DNSRecursive,
|
$DNSRecursive,
|
||||||
[parameter(
|
[parameter(Mandatory=$false,HelpMessage="Controls weather hostname DNS records are displayed",Position=9)]
|
||||||
Mandatory=$false,
|
|
||||||
ValueFromPipeline=$true,
|
|
||||||
ValueFromPipelineByPropertyName=$true,
|
|
||||||
HelpMessage="Controls weather hostname DNS records are displayed",
|
|
||||||
Position=9)]
|
|
||||||
[switch]
|
[switch]
|
||||||
$DNSRecords,
|
$DNSRecords,
|
||||||
[parameter(
|
[parameter(Mandatory=$false,HelpMessage="Controls if IP requests are allowed for subnet",Position=10)]
|
||||||
Mandatory=$false,
|
|
||||||
ValueFromPipeline=$true,
|
|
||||||
ValueFromPipelineByPropertyName=$true,
|
|
||||||
HelpMessage="Controls if IP requests are allowed for subnet",
|
|
||||||
Position=10)]
|
|
||||||
[switch]
|
[switch]
|
||||||
$AllowRequests,
|
$AllowRequests,
|
||||||
[parameter(
|
[parameter(Mandatory=$false,HelpMessage="Controls which scanagent to use for subnet (default id 1)",Position=11)]
|
||||||
Mandatory=$false,
|
[ValidateNotNullOrEmpty()]
|
||||||
ValueFromPipeline=$true,
|
[int]
|
||||||
ValueFromPipelineByPropertyName=$true,
|
|
||||||
HelpMessage="Controls which scanagent to use for subnet (default id 1)",
|
|
||||||
Position=11)]
|
|
||||||
[ValidateScript({ $_ -match "^\d+$" })]
|
|
||||||
[string]
|
|
||||||
$ScanAgentId,
|
$ScanAgentId,
|
||||||
[parameter(
|
[parameter(Mandatory=$false,HelpMessage="Controls if new hosts should be discovered for new host scans",Position=12)]
|
||||||
Mandatory=$false,
|
|
||||||
ValueFromPipeline=$true,
|
|
||||||
ValueFromPipelineByPropertyName=$true,
|
|
||||||
HelpMessage="Controls if new hosts should be discovered for new host scans",
|
|
||||||
Position=12)]
|
|
||||||
[switch]
|
[switch]
|
||||||
$DiscoverSubnet,
|
$DiscoverSubnet,
|
||||||
[parameter(
|
[parameter(Mandatory=$false,HelpMessage="Marks subnet as used",Position=12)]
|
||||||
Mandatory=$false,
|
|
||||||
ValueFromPipeline=$true,
|
|
||||||
ValueFromPipelineByPropertyName=$true,
|
|
||||||
HelpMessage="Marks subnet as used",
|
|
||||||
Position=12)]
|
|
||||||
[switch]
|
[switch]
|
||||||
$IsFull,
|
$IsFull,
|
||||||
[parameter(
|
[parameter(Mandatory=$false,HelpMessage="Assignes state (tag) to subnet (default: 1 Used)",Position=12)]
|
||||||
Mandatory=$false,
|
[ValidateNotNullOrEmpty()]
|
||||||
ValueFromPipeline=$true,
|
[int]
|
||||||
ValueFromPipelineByPropertyName=$true,
|
|
||||||
HelpMessage="Assignes state (tag) to subnet (default: 1 Used)",
|
|
||||||
Position=12)]
|
|
||||||
[ValidateScript({ $_ -match "^\d+$" })]
|
|
||||||
[string]
|
|
||||||
$TagId,
|
$TagId,
|
||||||
[parameter(
|
[parameter(Mandatory=$false,HelpMessage="Subnet threshold",Position=13)]
|
||||||
Mandatory=$false,
|
[ValidateScript({ $_ -le 100 -and $_ -ge 1 })]
|
||||||
ValueFromPipeline=$true,
|
[ValidateNotNullOrEmpty()]
|
||||||
ValueFromPipelineByPropertyName=$true,
|
[int]
|
||||||
HelpMessage="Subnet threshold",
|
|
||||||
Position=13)]
|
|
||||||
[ValidateScript({ $_ -match "^\d+$" -and $_ -le 100 -and $_ -ge 1 })]
|
|
||||||
$Threshold,
|
$Threshold,
|
||||||
[parameter(
|
[parameter(Mandatory=$false,HelpMessage="Location index",Position=14)]
|
||||||
Mandatory=$false,
|
[ValidateNotNullOrEmpty()]
|
||||||
ValueFromPipeline=$true,
|
[int]
|
||||||
ValueFromPipelineByPropertyName=$true,
|
|
||||||
HelpMessage="Location index",
|
|
||||||
Position=14)]
|
|
||||||
[ValidateScript({ $_ -match "^\d+$" })]
|
|
||||||
[string]
|
|
||||||
$LocationId,
|
$LocationId,
|
||||||
|
|
||||||
[parameter(Mandatory=$false,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)]
|
[parameter(Mandatory=$false,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)]
|
||||||
[ValidateScript({ $_ -is [Hashtable] -or $_ -is [PSCustomObject] })]
|
[ValidateScript({ $_ -is [Hashtable] -or $_ -is [PSCustomObject] })]
|
||||||
|
[ValidateNotNullOrEmpty()]
|
||||||
$CustomFields
|
$CustomFields
|
||||||
)
|
)
|
||||||
process {
|
process {
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ function Remove-Address {
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch ($PSCmdlet.ParameterSetName) {
|
switch ($PSCmdlet.ParameterSetName) {
|
||||||
"ByID" { $_identifiers = @($Id);break }
|
"ByID" { $_identifiers = @($Id); break }
|
||||||
"ByAddressObject" { $_identifiers = @($AddressObject.Id);break }
|
"ByAddressObject" { $_identifiers = @($AddressObject.Id); break }
|
||||||
}
|
}
|
||||||
$_params.Add("Identifiers",$_identifiers)
|
$_params.Add("Identifiers",$_identifiers)
|
||||||
|
|
||||||
|
|||||||
@@ -61,12 +61,12 @@ function Set-Address {
|
|||||||
)
|
)
|
||||||
process {
|
process {
|
||||||
$_params = @{
|
$_params = @{
|
||||||
Controller = "addresses"
|
Controller = [PS.IPAM.controllers]::addresses
|
||||||
Method = "PATCH"
|
Method = "PATCH"
|
||||||
}
|
}
|
||||||
switch ($PSCmdlet.ParameterSetName) {
|
switch ($PSCmdlet.ParameterSetName) {
|
||||||
"ByID" { $_id = $Id;break }
|
"ByID" { $_id = $Id; break }
|
||||||
"ByAddressObject" { $_id = $AddressObject.id;break }
|
"ByAddressObject" { $_id = $AddressObject.id; break }
|
||||||
}
|
}
|
||||||
$_identifiers = @($_id)
|
$_identifiers = @($_id)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user