From 006a645d9d1bdad28be786a0f5ef32b510ca03cb Mon Sep 17 00:00:00 2001 From: sheffsix Date: Thu, 16 Mar 2023 12:28:26 +0000 Subject: [PATCH] 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. --- .../DCIM/RearPorts/Add-NetboxDCIMRearPort.ps1 | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/Functions/DCIM/RearPorts/Add-NetboxDCIMRearPort.ps1 b/Functions/DCIM/RearPorts/Add-NetboxDCIMRearPort.ps1 index 4778316..aed9896 100644 --- a/Functions/DCIM/RearPorts/Add-NetboxDCIMRearPort.ps1 +++ b/Functions/DCIM/RearPorts/Add-NetboxDCIMRearPort.ps1 @@ -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