mirror of
https://github.com/benclaussen/NetboxPS.git
synced 2025-12-13 01:42:28 +00:00
63 lines
No EOL
1.9 KiB
PowerShell
63 lines
No EOL
1.9 KiB
PowerShell
<#
|
|
.NOTES
|
|
===========================================================================
|
|
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2020 v5.7.172
|
|
Created on: 3/23/2020 12:13
|
|
Created by: Claussen
|
|
Organization: NEOnet
|
|
Filename: Get-NetboxDCIMPlatform.ps1
|
|
===========================================================================
|
|
.DESCRIPTION
|
|
A description of the file.
|
|
#>
|
|
|
|
|
|
function Get-NetboxDCIMPlatform {
|
|
[CmdletBinding()]
|
|
[OutputType([pscustomobject])]
|
|
param
|
|
(
|
|
[uint16]$Limit,
|
|
|
|
[uint16]$Offset,
|
|
|
|
[Parameter(ParameterSetName = 'ById')]
|
|
[uint16[]]$Id,
|
|
|
|
[string]$Name,
|
|
|
|
[string]$Slug,
|
|
|
|
[uint16]$Manufacturer_Id,
|
|
|
|
[string]$Manufacturer,
|
|
|
|
[switch]$Raw
|
|
)
|
|
|
|
switch ($PSCmdlet.ParameterSetName) {
|
|
'ById' {
|
|
foreach ($PlatformID in $Id) {
|
|
$Segments = [System.Collections.ArrayList]::new(@('dcim', 'platforms', $PlatformID))
|
|
|
|
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters -SkipParameterByName 'Id', 'Raw'
|
|
|
|
$URI = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters
|
|
|
|
InvokeNetboxRequest -URI $URI -Raw:$Raw
|
|
}
|
|
|
|
break
|
|
}
|
|
|
|
default {
|
|
$Segments = [System.Collections.ArrayList]::new(@('dcim', 'platforms'))
|
|
|
|
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters -SkipParameterByName 'Raw'
|
|
|
|
$URI = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters
|
|
|
|
InvokeNetboxRequest -URI $URI -Raw:$Raw
|
|
}
|
|
}
|
|
} |