mirror of
https://github.com/benclaussen/NetboxPS.git
synced 2025-12-13 18:02:29 +00:00
* 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'
113 lines
2.9 KiB
PowerShell
113 lines
2.9 KiB
PowerShell
<#
|
|
.NOTES
|
|
===========================================================================
|
|
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2020 v5.7.172
|
|
Created on: 3/16/2020 16:34
|
|
Created by: Claussen
|
|
Organization: NEOnet
|
|
Filename: Get-NetboxIPAMVLAN.ps1
|
|
===========================================================================
|
|
.DESCRIPTION
|
|
A description of the file.
|
|
#>
|
|
|
|
|
|
function Get-NetboxIPAMVLAN {
|
|
[CmdletBinding()]
|
|
param
|
|
(
|
|
[Parameter(ParameterSetName = 'Query',
|
|
Position = 0)]
|
|
[ValidateRange(1, 4096)]
|
|
[uint16]$VID,
|
|
|
|
[Parameter(ParameterSetName = 'ByID')]
|
|
[uint32[]]$Id,
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
[string]$Query,
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
[string]$Name,
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
[string]$Tenant,
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
[uint32]$Tenant_Id,
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
[string]$TenantGroup,
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
[uint32]$TenantGroup_Id,
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
[object]$Status,
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
[string]$Region,
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
[string]$Site,
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
[uint32]$Site_Id,
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
[string]$Group,
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
[uint32]$Group_Id,
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
[string]$Role,
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
[uint32]$Role_Id,
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
[uint16]$Limit,
|
|
|
|
[Parameter(ParameterSetName = 'Query')]
|
|
[uint16]$Offset,
|
|
|
|
[switch]$Raw
|
|
)
|
|
|
|
# if ($null -ne $Status) {
|
|
# $PSBoundParameters.Status = ValidateIPAMChoice -ProvidedValue $Status -VLANStatus
|
|
# }
|
|
|
|
switch ($PSCmdlet.ParameterSetName) {
|
|
'ById' {
|
|
foreach ($VLAN_ID in $Id) {
|
|
$Segments = [System.Collections.ArrayList]::new(@('ipam', 'vlans', $VLAN_ID))
|
|
|
|
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters -SkipParameterByName 'Id'
|
|
|
|
$uri = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters
|
|
|
|
InvokeNetboxRequest -URI $uri -Raw:$Raw
|
|
}
|
|
|
|
break
|
|
}
|
|
|
|
default {
|
|
$Segments = [System.Collections.ArrayList]::new(@('ipam', 'vlans'))
|
|
|
|
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters
|
|
|
|
$uri = BuildNewURI -Segments $URIComponents.Segments -Parameters $URIComponents.Parameters
|
|
|
|
InvokeNetboxRequest -URI $uri -Raw:$Raw
|
|
|
|
break
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|