first working types
This commit is contained in:
@@ -1,26 +1,29 @@
|
||||
function Get-L2Domain {
|
||||
[CmdletBinding(DefaultParameterSetName="ByID")]
|
||||
[CmdletBinding(DefaultParameterSetName="NoParams")]
|
||||
[OutputType([PS.IPAM.Domain])]
|
||||
param (
|
||||
[parameter(Mandatory=$false,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true,Position=0)]
|
||||
[parameter(Mandatory=$false,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true,Position=0,ParameterSetName="ByID")]
|
||||
[ValidateScript({ $_ -match "^\d+$" })]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]
|
||||
[int]
|
||||
$Id
|
||||
)
|
||||
process {
|
||||
[string[]]$visiblePropertiesList = @('Id','Name','Description')
|
||||
$visibleProperties = [System.Management.Automation.PSPropertySet]::new('DefaultDisplayPropertySet',$visiblePropertiesList)
|
||||
|
||||
$_params = @{
|
||||
Controller = "l2domains"
|
||||
Method = "GET"
|
||||
Controller = [PS.IPAM.controllers]::l2domains
|
||||
Method = [PS.IPAM.methods]::GET
|
||||
Type = [PS.IPAM.types]::Domain
|
||||
}
|
||||
$_identifiers = @($Id)
|
||||
|
||||
switch ($PSCmdlet.ParameterSetName) {
|
||||
"ByID" {
|
||||
$_identifiers = @($Id)
|
||||
}
|
||||
}
|
||||
|
||||
$_params.Add("Identifiers",$_identifiers)
|
||||
|
||||
Invoke-Request @_params | `
|
||||
Add-Member -MemberType MemberSet -Name PSStandardMembers -Value $visibleProperties -PassThru
|
||||
Invoke-Request @_params
|
||||
}
|
||||
}
|
||||
Export-ModuleMember -Function Get-L2Domain
|
||||
Reference in New Issue
Block a user