IPAMAddress(New): Remove -Force parameter, use -Confirm if you want a confirmation

it is the standard with ShouldProcess
This commit is contained in:
Alexis La Goutte 2021-07-23 16:46:33 +02:00
parent b5d1036878
commit ad788e79da

View file

@ -56,9 +56,6 @@ function New-NetboxIPAMAddress {
.PARAMETER Assigned_Object_Id .PARAMETER Assigned_Object_Id
Assigned Object ID Assigned Object ID
.PARAMETER Force
Do not prompt for confirmation to create IP.
.PARAMETER Raw .PARAMETER Raw
Return raw results from API service Return raw results from API service
@ -103,8 +100,6 @@ function New-NetboxIPAMAddress {
[int]$Assigned_Object_Id, [int]$Assigned_Object_Id,
[switch]$Force,
[switch]$Raw [switch]$Raw
) )
@ -116,7 +111,7 @@ function New-NetboxIPAMAddress {
$URI = BuildNewURI -Segments $URIComponents.Segments $URI = BuildNewURI -Segments $URIComponents.Segments
if ($Force -or $PSCmdlet.ShouldProcess($Address, 'Create new IP address')) { if ($PSCmdlet.ShouldProcess($Address, 'Create new IP address')) {
InvokeNetboxRequest -URI $URI -Method $Method -Body $URIComponents.Parameters -Raw:$Raw InvokeNetboxRequest -URI $URI -Method $Method -Body $URIComponents.Parameters -Raw:$Raw
} }
} }