PSSA: Fix Command accepts pipeline input but has not defined a process block

This commit is contained in:
Alexis La Goutte 2021-07-23 21:09:06 +02:00
parent 76b891542e
commit 0217808bfc
8 changed files with 104 additions and 88 deletions

View file

@ -105,6 +105,7 @@ function Get-NetboxCircuit {
[switch]$Raw [switch]$Raw
) )
process {
switch ($PSCmdlet.ParameterSetName) { switch ($PSCmdlet.ParameterSetName) {
'ById' { 'ById' {
foreach ($i in $ID) { foreach ($i in $ID) {
@ -129,3 +130,4 @@ function Get-NetboxCircuit {
} }
} }
} }
}

View file

@ -54,6 +54,7 @@ function New-NetboxCircuit {
[switch]$Raw [switch]$Raw
) )
process {
$Segments = [System.Collections.ArrayList]::new(@('circuits', 'circuits')) $Segments = [System.Collections.ArrayList]::new(@('circuits', 'circuits'))
$Method = 'POST' $Method = 'POST'
@ -65,3 +66,4 @@ function New-NetboxCircuit {
InvokeNetboxRequest -URI $URI -Method $Method -Body $URIComponents.Parameters -Raw:$Raw InvokeNetboxRequest -URI $URI -Method $Method -Body $URIComponents.Parameters -Raw:$Raw
} }
} }
}

View file

@ -85,6 +85,7 @@ function Get-NetboxDCIMDevice {
#endregion Parameters #endregion Parameters
process {
if ($null -ne $Status) { if ($null -ne $Status) {
$PSBoundParameters.Status = ValidateDCIMChoice -ProvidedValue $Status -DeviceStatus $PSBoundParameters.Status = ValidateDCIMChoice -ProvidedValue $Status -DeviceStatus
} }
@ -97,3 +98,4 @@ function Get-NetboxDCIMDevice {
InvokeNetboxRequest -URI $URI -Raw:$Raw InvokeNetboxRequest -URI $URI -Raw:$Raw
} }
}

View file

@ -47,6 +47,7 @@ function Get-NetboxDCIMInterface {
[switch]$Raw [switch]$Raw
) )
process {
if ($null -ne $Form_Factor) { if ($null -ne $Form_Factor) {
$PSBoundParameters.Form_Factor = ValidateDCIMChoice -ProvidedValue $Form_Factor -InterfaceFormFactor $PSBoundParameters.Form_Factor = ValidateDCIMChoice -ProvidedValue $Form_Factor -InterfaceFormFactor
} }
@ -59,3 +60,4 @@ function Get-NetboxDCIMInterface {
InvokeNetboxRequest -URI $URI -Raw:$Raw InvokeNetboxRequest -URI $URI -Raw:$Raw
} }
}

View file

@ -81,6 +81,7 @@ function Get-NetboxDCIMSite {
[switch]$Raw [switch]$Raw
) )
process {
switch ($PSCmdlet.ParameterSetName) { switch ($PSCmdlet.ParameterSetName) {
'ById' { 'ById' {
foreach ($Site_ID in $ID) { foreach ($Site_ID in $ID) {
@ -105,4 +106,5 @@ function Get-NetboxDCIMSite {
} }
} }
} }
}

View file

@ -141,6 +141,7 @@ function Get-NetboxVirtualMachine {
[switch]$Raw [switch]$Raw
) )
process {
if ($null -ne $Status) { if ($null -ne $Status) {
$PSBoundParameters.Status = ValidateVirtualizationChoice -ProvidedValue $Status -VirtualMachineStatus $PSBoundParameters.Status = ValidateVirtualizationChoice -ProvidedValue $Status -VirtualMachineStatus
} }
@ -153,3 +154,4 @@ function Get-NetboxVirtualMachine {
InvokeNetboxRequest -URI $uri -Raw:$Raw InvokeNetboxRequest -URI $uri -Raw:$Raw
} }
}

View file

@ -54,6 +54,7 @@ function Set-NetboxVirtualMachine {
# $PSBoundParameters.Status = ValidateVirtualizationChoice -ProvidedValue $Status -VirtualMachineStatus # $PSBoundParameters.Status = ValidateVirtualizationChoice -ProvidedValue $Status -VirtualMachineStatus
# } # }
process {
$Segments = [System.Collections.ArrayList]::new(@('virtualization', 'virtual-machines', $Id)) $Segments = [System.Collections.ArrayList]::new(@('virtualization', 'virtual-machines', $Id))
Write-Verbose "Obtaining VM from ID $Id" Write-Verbose "Obtaining VM from ID $Id"
@ -70,3 +71,4 @@ function Set-NetboxVirtualMachine {
InvokeNetboxRequest -URI $URI -Body $URIComponents.Parameters -Method PATCH InvokeNetboxRequest -URI $URI -Body $URIComponents.Parameters -Method PATCH
} }
} }
}

View file

@ -84,6 +84,7 @@ function Get-NetboxVirtualMachineInterface {
[switch]$Raw [switch]$Raw
) )
process {
$Segments = [System.Collections.ArrayList]::new(@('virtualization', 'interfaces')) $Segments = [System.Collections.ArrayList]::new(@('virtualization', 'interfaces'))
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters $URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters
@ -92,3 +93,4 @@ function Get-NetboxVirtualMachineInterface {
InvokeNetboxRequest -URI $uri -Raw:$Raw InvokeNetboxRequest -URI $uri -Raw:$Raw
} }
}