38 lines
888 B
PowerShell
38 lines
888 B
PowerShell
function Get-Vrf {
|
|
<#
|
|
.SYNOPSIS
|
|
|
|
Returns VRF object.
|
|
|
|
.DESCRIPTION
|
|
|
|
Returns VRF by id. Or leave it empty to get all VRFs.
|
|
#>
|
|
[CmdletBinding(DefaultParameterSetName="NoParams")]
|
|
[OutputType([PS.IPAM.Vrf])]
|
|
param (
|
|
[parameter(
|
|
Mandatory=$true,
|
|
ValueFromPipeline=$true,
|
|
ValueFromPipelineByPropertyName=$true,
|
|
Position=0,
|
|
ParameterSetName="ByID"
|
|
)]
|
|
[ValidateNotNullOrEmpty()]
|
|
[int]
|
|
$Id
|
|
)
|
|
process {
|
|
$_params = @{
|
|
Controller = [PS.IPAM.controllers]::vrf
|
|
Method = "GET"
|
|
Type = [PS.IPAM.types]::vrf
|
|
}
|
|
if ($Id) { $_identifiers = @($Id) }
|
|
|
|
$_params.Add("Identifiers",$_identifiers)
|
|
|
|
Invoke-Request @_params
|
|
}
|
|
}
|
|
Export-ModuleMember -Function Get-Vrf |