mirror of
https://github.com/benclaussen/NetboxPS.git
synced 2025-12-13 18:02:29 +00:00
Fix braces
This commit is contained in:
parent
7c03023bb8
commit
0049ba4985
1 changed files with 28 additions and 34 deletions
|
|
@ -1,65 +1,59 @@
|
||||||
|
|
||||||
function Set-NetboxDCIMRearPort
|
function Set-NetboxDCIMRearPort {
|
||||||
{
|
|
||||||
[CmdletBinding(ConfirmImpact = 'Medium',
|
[CmdletBinding(ConfirmImpact = 'Medium',
|
||||||
SupportsShouldProcess = $true)]
|
SupportsShouldProcess = $true)]
|
||||||
[OutputType([pscustomobject])]
|
[OutputType([pscustomobject])]
|
||||||
param
|
param
|
||||||
(
|
(
|
||||||
[Parameter(Mandatory = $true,
|
[Parameter(Mandatory = $true,
|
||||||
ValueFromPipelineByPropertyName = $true)]
|
ValueFromPipelineByPropertyName = $true)]
|
||||||
[uint16[]]$Id,
|
[uint16[]]$Id,
|
||||||
|
|
||||||
[uint16]$Device,
|
[uint16]$Device,
|
||||||
|
|
||||||
[uint16]$Module,
|
[uint16]$Module,
|
||||||
|
|
||||||
[string]$Name,
|
[string]$Name,
|
||||||
|
|
||||||
[string]$Label,
|
[string]$Label,
|
||||||
|
|
||||||
[string]$Type,
|
[string]$Type,
|
||||||
|
|
||||||
[ValidatePattern('^[0-9a-f]{6}$')]
|
[ValidatePattern('^[0-9a-f]{6}$')]
|
||||||
[string]$Color,
|
[string]$Color,
|
||||||
|
|
||||||
[uint16]$Positions,
|
[uint16]$Positions,
|
||||||
|
|
||||||
[string]$Description,
|
[string]$Description,
|
||||||
|
|
||||||
[bool]$Mark_Connected,
|
[bool]$Mark_Connected,
|
||||||
|
|
||||||
[uint16[]]$Tags,
|
[uint16[]]$Tags,
|
||||||
|
|
||||||
[switch]$Force
|
[switch]$Force
|
||||||
)
|
)
|
||||||
|
|
||||||
begin
|
begin {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
process
|
process {
|
||||||
{
|
foreach ($RearPortID in $Id) {
|
||||||
foreach ($RearPortID in $Id)
|
|
||||||
{
|
|
||||||
$CurrentPort = Get-NetboxDCIMRearPort -Id $RearPortID -ErrorAction Stop
|
$CurrentPort = Get-NetboxDCIMRearPort -Id $RearPortID -ErrorAction Stop
|
||||||
|
|
||||||
$Segments = [System.Collections.ArrayList]::new(@('dcim', 'rear-ports', $CurrentPort.Id))
|
$Segments = [System.Collections.ArrayList]::new(@('dcim', 'rear-ports', $CurrentPort.Id))
|
||||||
|
|
||||||
$URIComponents = BuildURIComponents -URISegments $Segments.Clone() -ParametersDictionary $PSBoundParameters -SkipParameterByName 'Id'
|
$URIComponents = BuildURIComponents -URISegments $Segments.Clone() -ParametersDictionary $PSBoundParameters -SkipParameterByName 'Id'
|
||||||
|
|
||||||
$URI = BuildNewURI -Segments $Segments
|
$URI = BuildNewURI -Segments $Segments
|
||||||
|
|
||||||
if ($Force -or $pscmdlet.ShouldProcess("Rear Port ID $($CurrentPort.Id)", "Set"))
|
if ($Force -or $pscmdlet.ShouldProcess("Rear Port ID $($CurrentPort.Id)", "Set")) {
|
||||||
{
|
|
||||||
InvokeNetboxRequest -URI $URI -Body $URIComponents.Parameters -Method PATCH
|
InvokeNetboxRequest -URI $URI -Body $URIComponents.Parameters -Method PATCH
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
end
|
end {
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Reference in a new issue