first working types
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
function Get-Tag {
|
||||
[CmdletBinding(DefaultParameterSetName="NoParams")]
|
||||
[OutputType({[types]::tag})]
|
||||
[OutputType([PS.IPAM.Tag])]
|
||||
param (
|
||||
[parameter(Mandatory=$false,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true,Position=0,ParameterSetName="ByID")]
|
||||
[ValidateScript({ $_ -match "^\d+$" })]
|
||||
@@ -18,16 +18,24 @@ function Get-Tag {
|
||||
)
|
||||
process {
|
||||
$_params = @{
|
||||
Controller = [controllers]::addresses
|
||||
Method = [methods]::GET
|
||||
Type = [types]::tag
|
||||
Controller = [PS.IPAM.controllers]::addresses
|
||||
Method = [PS.IPAM.methods]::GET
|
||||
Type = [PS.IPAM.types]::tag
|
||||
}
|
||||
$_identifiers = @("tags")
|
||||
switch ($PSCmdlet.ParameterSetName) {
|
||||
"ByID" { $_identifiers += $Id }
|
||||
"ByID" { $_identifiers += $Id; break }
|
||||
"ByAddressObject" {
|
||||
if ($InputObject.TagId) {
|
||||
$_identifiers += $InputObject.TagId
|
||||
if ($AddressObject.TagId) {
|
||||
$_identifiers += $AddressObject.TagId
|
||||
} else {
|
||||
return $null
|
||||
}
|
||||
break
|
||||
}
|
||||
"BySubnetObject" {
|
||||
if ($SubnetObject.TagId) {
|
||||
$_identifiers += $SubnetObject.TagId
|
||||
} else {
|
||||
return $null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user