Remove Tags_Slug parameter

In hindsight implementing would create extra work that could be hard to
maintain. Can be easily achieved outside of the function.
This commit is contained in:
sheffsix 2023-03-16 12:28:26 +00:00
parent ec1eb869b3
commit 006a645d9d

View file

@ -25,28 +25,17 @@
[bool]$Mark_Connected,
[uint16[]]$Tags,
[string[]]$Tags_Slug
[uint16[]]$Tags
)
begin {
if (-not [System.String]::IsNullOrWhiteSpace($Tags_Slug)) {
if ([System.String]::IsNullOrWhiteSpace($Tags)) {
$PSBoundParameters.Tags = @()
}
foreach ($CurrentTagSlug in $Tags_Slug) {
$CurrentTagID = (Get-NetboxTag -slug $CurrentTagSlug -ErrorAction Stop).Id
$PSBoundParameters.Tags += $CurrentTagID
}
}
}
process {
$Segments = [System.Collections.ArrayList]::new(@('dcim', 'rear-ports'))
$URIComponents = BuildURIComponents -URISegments $Segments.Clone() -ParametersDictionary $PSBoundParameters -SkipParameterByName 'Tags_Slug'
$URIComponents = BuildURIComponents -URISegments $Segments.Clone() -ParametersDictionary $PSBoundParameters
$URI = BuildNewURI -Segments $URIComponents.Segments