Files
ps.ipam/functions/public/Get-L2Domain.ps1
2022-12-06 17:20:45 +03:00

29 lines
851 B
PowerShell

function Get-L2Domain {
[CmdletBinding(DefaultParameterSetName="NoParams")]
[OutputType([PS.IPAM.Domain])]
param (
[parameter(Mandatory=$false,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true,Position=0,ParameterSetName="ByID")]
[ValidateScript({ $_ -match "^\d+$" })]
[ValidateNotNullOrEmpty()]
[int]
$Id
)
process {
$_params = @{
Controller = [PS.IPAM.controllers]::l2domains
Method = [PS.IPAM.methods]::GET
Type = [PS.IPAM.types]::Domain
}
switch ($PSCmdlet.ParameterSetName) {
"ByID" {
$_identifiers = @($Id)
}
}
$_params.Add("Identifiers",$_identifiers)
Invoke-Request @_params
}
}
Export-ModuleMember -Function Get-L2Domain