Address(IPAM): Fix PSSA about Command accepts pipeline input but not defined a process block

This commit is contained in:
Alexis La Goutte 2021-03-29 15:55:14 +02:00
parent 354aeb66d3
commit eea2eebc82
2 changed files with 25 additions and 21 deletions

View file

@ -54,6 +54,7 @@ function Get-NetboxIPAMAvailableIP {
[switch]$Raw [switch]$Raw
) )
process {
$Segments = [System.Collections.ArrayList]::new(@('ipam', 'prefixes', $Prefix_ID, 'available-ips')) $Segments = [System.Collections.ArrayList]::new(@('ipam', 'prefixes', $Prefix_ID, 'available-ips'))
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters -SkipParameterByName 'prefix_id' $URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters -SkipParameterByName 'prefix_id'
@ -61,4 +62,5 @@ function Get-NetboxIPAMAvailableIP {
$uri = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters $uri = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters
InvokeNetboxRequest -URI $uri -Raw:$Raw InvokeNetboxRequest -URI $uri -Raw:$Raw
}
} }

View file

@ -90,6 +90,7 @@ function New-NetboxIPAMAddress {
[switch]$Raw [switch]$Raw
) )
process {
$Segments = [System.Collections.ArrayList]::new(@('ipam', 'ip-addresses')) $Segments = [System.Collections.ArrayList]::new(@('ipam', 'ip-addresses'))
$Method = 'POST' $Method = 'POST'
@ -111,6 +112,7 @@ function New-NetboxIPAMAddress {
if ($Force -or $PSCmdlet.ShouldProcess($Address, 'Create new IP address')) { if ($Force -or $PSCmdlet.ShouldProcess($Address, 'Create new IP address')) {
InvokeNetboxRequest -URI $URI -Method $Method -Body $URIComponents.Parameters -Raw:$Raw InvokeNetboxRequest -URI $URI -Method $Method -Body $URIComponents.Parameters -Raw:$Raw
} }
}
} }