NetboxPS/Functions/DCIM/Devices/Get-NetboxDCIMDevice.ps1
Alexis La Goutte 8167b0dbf0
Fix PSSA Warning (#20)
* Fix trailing white space

using Invoke-ScriptAnalyzer -Fix -Path . -Recurse

* add settings.json for configure Visual Code (Formatter)

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

* PSSA: Fix PSUseDeclaredVarsMoreThanAssignments

The variable 'I_B' is assigned but never used
The variable 'I_A' is assigned but never used

* PSSA: Fix PSUseShouldProcessForStateChangingFunctions

Function New-/Set-... has verb that could change system state. Therefore, the function has to support 'ShouldProcess'
2021-07-23 16:06:42 -04:00

101 lines
No EOL
2 KiB
PowerShell

<#
.NOTES
===========================================================================
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2020 v5.7.172
Created on: 3/23/2020 12:06
Created by: Claussen
Organization: NEOnet
Filename: Get-NetboxDCIMDevice.ps1
===========================================================================
.DESCRIPTION
A description of the file.
#>
function Get-NetboxDCIMDevice {
[CmdletBinding()]
#region Parameters
param
(
[uint16]$Limit,
[uint16]$Offset,
[Parameter(ValueFromPipelineByPropertyName = $true)]
[uint16[]]$Id,
[string]$Query,
[string]$Name,
[uint16]$Manufacturer_Id,
[string]$Manufacturer,
[uint16]$Device_Type_Id,
[uint16]$Role_Id,
[string]$Role,
[uint16]$Tenant_Id,
[string]$Tenant,
[uint16]$Platform_Id,
[string]$Platform,
[string]$Asset_Tag,
[uint16]$Site_Id,
[string]$Site,
[uint16]$Rack_Group_Id,
[uint16]$Rack_Id,
[uint16]$Cluster_Id,
[uint16]$Model,
[object]$Status,
[bool]$Is_Full_Depth,
[bool]$Is_Console_Server,
[bool]$Is_PDU,
[bool]$Is_Network_Device,
[string]$MAC_Address,
[bool]$Has_Primary_IP,
[uint16]$Virtual_Chassis_Id,
[uint16]$Position,
[string]$Serial,
[switch]$Raw
)
#endregion Parameters
process {
if ($null -ne $Status) {
$PSBoundParameters.Status = ValidateDCIMChoice -ProvidedValue $Status -DeviceStatus
}
$Segments = [System.Collections.ArrayList]::new(@('dcim', 'devices'))
$URIComponents = BuildURIComponents -URISegments $Segments.Clone() -ParametersDictionary $PSBoundParameters -SkipParameterByName 'Raw'
$URI = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters
InvokeNetboxRequest -URI $URI -Raw:$Raw
}
}