NetboxPS/Functions/DCIM/Get-NetboxDCIMPlatform.ps1

63 lines
1.7 KiB
PowerShell
Raw Normal View History

<#
2018-05-23 11:10:40 -04:00
.NOTES
===========================================================================
2020-03-23 12:18:01 -04:00
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2020 v5.7.172
Created on: 3/23/2020 12:13
Created by: Claussen
2018-05-23 11:10:40 -04:00
Organization: NEOnet
2020-03-23 12:18:01 -04:00
Filename: Get-NetboxDCIMPlatform.ps1
2018-05-23 11:10:40 -04:00
===========================================================================
.DESCRIPTION
A description of the file.
#>
2018-05-25 15:11:59 -04:00
function Get-NetboxDCIMPlatform {
[CmdletBinding()]
2018-05-25 15:11:59 -04:00
[OutputType([pscustomobject])]
param
(
[uint16]$Limit,
[uint16]$Offset,
[Parameter(ParameterSetName = 'ById')]
[uint16[]]$Id,
[string]$Name,
[string]$Slug,
2018-05-25 15:11:59 -04:00
[uint16]$Manufacturer_Id,
2018-05-25 15:11:59 -04:00
[string]$Manufacturer,
[switch]$Raw
)
switch ($PSCmdlet.ParameterSetName) {
'ById' {
2018-05-25 15:11:59 -04:00
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 {
2018-05-25 15:11:59 -04:00
$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
}
}
2020-03-23 12:18:01 -04:00
}