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
|
||||
Reference in New Issue
Block a user