mirror of
https://github.com/benclaussen/NetboxPS.git
synced 2025-12-13 18:02:29 +00:00
Correct variable references in ShouldProcess
This commit is contained in:
parent
b441e02e2b
commit
59a28faff5
4 changed files with 8 additions and 8 deletions
|
|
@ -60,7 +60,7 @@ function New-NetboxContactRole {
|
||||||
|
|
||||||
$URI = BuildNewURI -Segments $URIComponents.Segments
|
$URI = BuildNewURI -Segments $URIComponents.Segments
|
||||||
|
|
||||||
if ($PSCmdlet.ShouldProcess($Address, 'Create new contact')) {
|
if ($PSCmdlet.ShouldProcess($Name, 'Create new contact')) {
|
||||||
InvokeNetboxRequest -URI $URI -Method $Method -Body $URIComponents.Parameters -Raw:$Raw
|
InvokeNetboxRequest -URI $URI -Method $Method -Body $URIComponents.Parameters -Raw:$Raw
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ function New-NetboxContact {
|
||||||
|
|
||||||
$URI = BuildNewURI -Segments $URIComponents.Segments
|
$URI = BuildNewURI -Segments $URIComponents.Segments
|
||||||
|
|
||||||
if ($PSCmdlet.ShouldProcess($Address, 'Create new contact')) {
|
if ($PSCmdlet.ShouldProcess($Name, 'Create new contact')) {
|
||||||
InvokeNetboxRequest -URI $URI -Method $Method -Body $URIComponents.Parameters -Raw:$Raw
|
InvokeNetboxRequest -URI $URI -Method $Method -Body $URIComponents.Parameters -Raw:$Raw
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ function Set-NetboxContact {
|
||||||
|
|
||||||
$URI = BuildNewURI -Segments $URIComponents.Segments
|
$URI = BuildNewURI -Segments $URIComponents.Segments
|
||||||
|
|
||||||
$CurrentContact = Get-NetboxContact -Id $ContactId
|
$CurrentContact = Get-NetboxContact -Id $ContactId -ErrorAction Stop
|
||||||
|
|
||||||
if ($Force -or $PSCmdlet.ShouldProcess($CurrentContact.Name, 'Update contact')) {
|
if ($Force -or $PSCmdlet.ShouldProcess($CurrentContact.Name, 'Update contact')) {
|
||||||
InvokeNetboxRequest -URI $URI -Method $Method -Body $URIComponents.Parameters -Raw:$Raw
|
InvokeNetboxRequest -URI $URI -Method $Method -Body $URIComponents.Parameters -Raw:$Raw
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue