first working types

This commit is contained in:
2022-12-06 17:20:45 +03:00
parent a1b03b81c0
commit 7d0d1b53ae
14 changed files with 129 additions and 75 deletions

View File

@@ -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
}