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])]
|
[OutputType([pscustomobject])]
|
||||||
param
|
param
|
||||||
(
|
(
|
||||||
[Parameter(Mandatory = $true)]
|
[Parameter(Mandatory = $true,
|
||||||
|
ValueFromPipelineByPropertyName = $true)]
|
||||||
[string]$Address,
|
[string]$Address,
|
||||||
|
|
||||||
[object]$Status = 'Active',
|
[object]$Status = 'Active',
|
||||||
|
|
@ -92,17 +93,17 @@ function New-NetboxIPAMAddress {
|
||||||
$Segments = [System.Collections.ArrayList]::new(@('ipam', 'ip-addresses'))
|
$Segments = [System.Collections.ArrayList]::new(@('ipam', 'ip-addresses'))
|
||||||
$Method = 'POST'
|
$Method = 'POST'
|
||||||
|
|
||||||
# # Value validation
|
# # Value validation
|
||||||
# $ModelDefinition = GetModelDefinitionFromURIPath -Segments $Segments -Method $Method
|
# $ModelDefinition = GetModelDefinitionFromURIPath -Segments $Segments -Method $Method
|
||||||
# $EnumProperties = GetModelEnumProperties -ModelDefinition $ModelDefinition
|
# $EnumProperties = GetModelEnumProperties -ModelDefinition $ModelDefinition
|
||||||
#
|
#
|
||||||
# foreach ($Property in $EnumProperties.Keys) {
|
# foreach ($Property in $EnumProperties.Keys) {
|
||||||
# if ($PSBoundParameters.ContainsKey($Property)) {
|
# if ($PSBoundParameters.ContainsKey($Property)) {
|
||||||
# Write-Verbose "Validating property [$Property] with value [$($PSBoundParameters.$Property)]"
|
# Write-Verbose "Validating property [$Property] with value [$($PSBoundParameters.$Property)]"
|
||||||
# $PSBoundParameters.$Property = ValidateValue -ModelDefinition $ModelDefinition -Property $Property -ProvidedValue $PSBoundParameters.$Property
|
# $PSBoundParameters.$Property = ValidateValue -ModelDefinition $ModelDefinition -Property $Property -ProvidedValue $PSBoundParameters.$Property
|
||||||
# }
|
# }
|
||||||
# }
|
# }
|
||||||
#
|
#
|
||||||
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters
|
$URIComponents = BuildURIComponents -URISegments $Segments -ParametersDictionary $PSBoundParameters
|
||||||
|
|
||||||
$URI = BuildNewURI -Segments $URIComponents.Segments
|
$URI = BuildNewURI -Segments $URIComponents.Segments
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue