first working types

This commit is contained in:
2022-12-06 17:20:45 +03:00
parent a1b03b81c0
commit 7d0d1b53ae
14 changed files with 129 additions and 75 deletions

View File

@@ -1,5 +1,6 @@
function Get-Subnet {
[CmdletBinding(DefaultParameterSetName="ByID")]
[CmdletBinding(DefaultParameterSetName="NoParams")]
[OutputType([PS.IPAM.Subnetwork])]
param (
[parameter(Mandatory=$true,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true,Position=0,ParameterSetName="ByCIDR")]
[ValidateScript({[ipaddress] $_.Split("/")[0] -and $_.Split("/")[1] -match "\d{1,2}"})]
@@ -52,13 +53,10 @@ function Get-Subnet {
$Recurse
)
process {
[string[]]$visiblePropertiesList = @('Id','Subnet','Mask','Description')
$visibleProperties = [System.Management.Automation.PSPropertySet]::new('DefaultDisplayPropertySet',$visiblePropertiesList)
$_params = @{
Controller = "subnets"
Method = "GET"
Type = "subnet"
Controller = [PS.IPAM.controllers]::subnets
Method = [PS.IPAM.methods]::GET
Type = [PS.IPAM.types]::Subnetwork
}
switch ($PSCmdlet.ParameterSetName) {
"ByCIDR" {