mirror of
https://github.com/benclaussen/NetboxPS.git
synced 2025-12-13 18:02:29 +00:00
Allow pipeline input for Address parameter in New-NetboxIPAMAddress
This commit is contained in:
parent
a905a8d598
commit
9649237394
1 changed files with 13 additions and 12 deletions
|
|
@ -65,7 +65,8 @@ function New-NetboxIPAMAddress {
|
|||
[OutputType([pscustomobject])]
|
||||
param
|
||||
(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[Parameter(Mandatory = $true,
|
||||
ValueFromPipelineByPropertyName = $true)]
|
||||
[string]$Address,
|
||||
|
||||
[object]$Status = 'Active',
|
||||
|
|
@ -92,17 +93,17 @@ function New-NetboxIPAMAddress {
|
|||
$Segments = [System.Collections.ArrayList]::new(@('ipam', 'ip-addresses'))
|
||||
$Method = 'POST'
|
||||
|
||||
# # Value validation
|
||||
# $ModelDefinition = GetModelDefinitionFromURIPath -Segments $Segments -Method $Method
|
||||
# $EnumProperties = GetModelEnumProperties -ModelDefinition $ModelDefinition
|
||||
#
|
||||
# foreach ($Property in $EnumProperties.Keys) {
|
||||
# if ($PSBoundParameters.ContainsKey($Property)) {
|
||||
# Write-Verbose "Validating property [$Property] with value [$($PSBoundParameters.$Property)]"
|
||||
# $PSBoundParameters.$Property = ValidateValue -ModelDefinition $ModelDefinition -Property $Property -ProvidedValue $PSBoundParameters.$Property
|
||||
# }
|
||||
# }
|
||||
#
|
||||
# # Value validation
|
||||
# $ModelDefinition = GetModelDefinitionFromURIPath -Segments $Segments -Method $Method
|
||||
# $EnumProperties = GetModelEnumProperties -ModelDefinition $ModelDefinition
|
||||
#
|
||||
# foreach ($Property in $EnumProperties.Keys) {
|
||||
# if ($PSBoundParameters.ContainsKey($Property)) {
|
||||
# Write-Verbose "Validating property [$Property] with value [$($PSBoundParameters.$Property)]"
|
||||
# $PSBoundParameters.$Property = ValidateValue -ModelDefinition $ModelDefinition -Property $Property -ProvidedValue $PSBoundParameters.$Property
|
||||
# }
|
||||
# }
|
||||
#
|
||||
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters
|
||||
|
||||
$URI = BuildNewURI -Segments $URIComponents.Segments
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue