replaced hardcoded text by enums in some functions

This commit is contained in:
2022-12-05 17:48:20 +03:00
parent 4fc6bac4b5
commit a1b03b81c0
4 changed files with 39 additions and 27 deletions

View File

@@ -1,6 +1,6 @@
function Get-Tag {
[CmdletBinding(DefaultParameterSetName="NoParams")]
[OutputType('tag')]
[OutputType({[types]::tag})]
param (
[parameter(Mandatory=$false,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true,Position=0,ParameterSetName="ByID")]
[ValidateScript({ $_ -match "^\d+$" })]
@@ -9,14 +9,18 @@ function Get-Tag {
$Id,
[parameter(Mandatory=$false,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true,Position=0,ParameterSetName="ByAddressObject")]
[ValidateNotNullOrEmpty()]
[ps.ipam.address]
$InputObject
[PS.IPAM.Address]
$AddressObject,
[parameter(Mandatory=$false,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true,Position=0,ParameterSetName="BySubnetObject")]
[ValidateNotNullOrEmpty()]
[PS.IPAM.Subnetwork]
$SubnetObject
)
process {
$_params = @{
Controller = "addresses"
Method = "GET"
Type = "tag"
Controller = [controllers]::addresses
Method = [methods]::GET
Type = [types]::tag
}
$_identifiers = @("tags")
switch ($PSCmdlet.ParameterSetName) {