mirror of
https://github.com/benclaussen/NetboxPS.git
synced 2025-12-15 18:55:46 +00:00
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:
parent
ec1eb869b3
commit
006a645d9d
1 changed files with 3 additions and 14 deletions
|
|
@ -25,28 +25,17 @@
|
||||||
|
|
||||||
[bool]$Mark_Connected,
|
[bool]$Mark_Connected,
|
||||||
|
|
||||||
[uint16[]]$Tags,
|
[uint16[]]$Tags
|
||||||
|
|
||||||
[string[]]$Tags_Slug
|
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
begin {
|
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 {
|
process {
|
||||||
$Segments = [System.Collections.ArrayList]::new(@('dcim', 'rear-ports'))
|
$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
|
$URI = BuildNewURI -Segments $URIComponents.Segments
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue