mirror of
https://github.com/benclaussen/NetboxPS.git
synced 2025-12-16 03:05:47 +00:00
PSSA: Fix Command accepts pipeline input but has not defined a process block
This commit is contained in:
parent
76b891542e
commit
0217808bfc
8 changed files with 104 additions and 88 deletions
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
|
||||
function Get-NetboxCircuit {
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Gets one or more circuits
|
||||
|
||||
|
|
@ -105,6 +105,7 @@ function Get-NetboxCircuit {
|
|||
[switch]$Raw
|
||||
)
|
||||
|
||||
process {
|
||||
switch ($PSCmdlet.ParameterSetName) {
|
||||
'ById' {
|
||||
foreach ($i in $ID) {
|
||||
|
|
@ -128,4 +129,5 @@ function Get-NetboxCircuit {
|
|||
InvokeNetboxRequest -URI $URI -Raw:$Raw
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -54,6 +54,7 @@ function New-NetboxCircuit {
|
|||
[switch]$Raw
|
||||
)
|
||||
|
||||
process {
|
||||
$Segments = [System.Collections.ArrayList]::new(@('circuits', 'circuits'))
|
||||
$Method = 'POST'
|
||||
|
||||
|
|
@ -64,4 +65,5 @@ function New-NetboxCircuit {
|
|||
if ($Force -or $PSCmdlet.ShouldProcess($CID, 'Create new circuit')) {
|
||||
InvokeNetboxRequest -URI $URI -Method $Method -Body $URIComponents.Parameters -Raw:$Raw
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -85,6 +85,7 @@ function Get-NetboxDCIMDevice {
|
|||
|
||||
#endregion Parameters
|
||||
|
||||
process {
|
||||
if ($null -ne $Status) {
|
||||
$PSBoundParameters.Status = ValidateDCIMChoice -ProvidedValue $Status -DeviceStatus
|
||||
}
|
||||
|
|
@ -96,4 +97,5 @@ function Get-NetboxDCIMDevice {
|
|||
$URI = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters
|
||||
|
||||
InvokeNetboxRequest -URI $URI -Raw:$Raw
|
||||
}
|
||||
}
|
||||
|
|
@ -47,6 +47,7 @@ function Get-NetboxDCIMInterface {
|
|||
[switch]$Raw
|
||||
)
|
||||
|
||||
process {
|
||||
if ($null -ne $Form_Factor) {
|
||||
$PSBoundParameters.Form_Factor = ValidateDCIMChoice -ProvidedValue $Form_Factor -InterfaceFormFactor
|
||||
}
|
||||
|
|
@ -58,4 +59,5 @@ function Get-NetboxDCIMInterface {
|
|||
$URI = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters
|
||||
|
||||
InvokeNetboxRequest -URI $URI -Raw:$Raw
|
||||
}
|
||||
}
|
||||
|
|
@ -81,6 +81,7 @@ function Get-NetboxDCIMSite {
|
|||
[switch]$Raw
|
||||
)
|
||||
|
||||
process {
|
||||
switch ($PSCmdlet.ParameterSetName) {
|
||||
'ById' {
|
||||
foreach ($Site_ID in $ID) {
|
||||
|
|
@ -104,5 +105,6 @@ function Get-NetboxDCIMSite {
|
|||
InvokeNetboxRequest -URI $URI -Raw:$Raw
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
|
||||
function Get-NetboxVirtualMachine {
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Obtains virtual machines from Netbox.
|
||||
|
||||
|
|
@ -141,6 +141,7 @@ function Get-NetboxVirtualMachine {
|
|||
[switch]$Raw
|
||||
)
|
||||
|
||||
process {
|
||||
if ($null -ne $Status) {
|
||||
$PSBoundParameters.Status = ValidateVirtualizationChoice -ProvidedValue $Status -VirtualMachineStatus
|
||||
}
|
||||
|
|
@ -152,4 +153,5 @@ function Get-NetboxVirtualMachine {
|
|||
$uri = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters
|
||||
|
||||
InvokeNetboxRequest -URI $uri -Raw:$Raw
|
||||
}
|
||||
}
|
||||
|
|
@ -50,10 +50,11 @@ function Set-NetboxVirtualMachine {
|
|||
[switch]$Force
|
||||
)
|
||||
|
||||
# if ($null -ne $Status) {
|
||||
# $PSBoundParameters.Status = ValidateVirtualizationChoice -ProvidedValue $Status -VirtualMachineStatus
|
||||
# }
|
||||
# if ($null -ne $Status) {
|
||||
# $PSBoundParameters.Status = ValidateVirtualizationChoice -ProvidedValue $Status -VirtualMachineStatus
|
||||
# }
|
||||
|
||||
process {
|
||||
$Segments = [System.Collections.ArrayList]::new(@('virtualization', 'virtual-machines', $Id))
|
||||
|
||||
Write-Verbose "Obtaining VM from ID $Id"
|
||||
|
|
@ -69,4 +70,5 @@ function Set-NetboxVirtualMachine {
|
|||
|
||||
InvokeNetboxRequest -URI $URI -Body $URIComponents.Parameters -Method PATCH
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
|
||||
function Get-NetboxVirtualMachineInterface {
|
||||
<#
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Gets VM interfaces
|
||||
|
||||
|
|
@ -84,6 +84,7 @@ function Get-NetboxVirtualMachineInterface {
|
|||
[switch]$Raw
|
||||
)
|
||||
|
||||
process {
|
||||
$Segments = [System.Collections.ArrayList]::new(@('virtualization', 'interfaces'))
|
||||
|
||||
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters
|
||||
|
|
@ -91,4 +92,5 @@ function Get-NetboxVirtualMachineInterface {
|
|||
$uri = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters
|
||||
|
||||
InvokeNetboxRequest -URI $uri -Raw:$Raw
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue