Skip to content

Commit

Permalink
Fix ShouldProcess logic
Browse files Browse the repository at this point in the history
  • Loading branch information
fvanroie committed May 26, 2018
1 parent 7a0e2e2 commit 6ff6bbd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Public/Legacy/Reset-OPNsenseConfig.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ Function Reset-OPNsenseConfig {
}

Write-Warning '!!! YOU ARE ABOUT TO COMPLETELY ERASE THE OPNSENSE CONFIGURATION !!!'
if ($PSCmdlet.ShouldProcess($Uri, "Reset OPNsense to factory defaults")) {
if (-Not $PSCmdlet.ShouldProcess($Uri, "Reset OPNsense to factory defaults")) {
Write-Warning 'Aborting Reset-OPNsenseConfig'
Return
}

Write-Warning '!!! YOU ARE ABOUT TO COMPLETELY ERASE THE OPNSENSE CONFIGURATION !!!'
if ($PSCmdlet.ShouldProcess($Uri, "LAST WARNING: Reset OPNsense to factory defaults")) {
if (-Not $PSCmdlet.ShouldProcess($Uri, "LAST WARNING: Reset OPNsense to factory defaults")) {
Write-Warning 'Aborting Reset-OPNsenseConfig'
Return
}
Expand Down
2 changes: 1 addition & 1 deletion Public/Legacy/Restore-OPNsenseConfig.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ Content-Disposition: form-data; name="{1}"
Throw "No web password has been set."
}

if ($PSCmdlet.ShouldProcess($Uri, "Restore OPNsense configuration")) {
if (-Not $PSCmdlet.ShouldProcess($Uri, "Restore OPNsense configuration")) {
Write-Warning 'Aborting Restore-OPNsenseConfig'
Return
}
Expand Down

0 comments on commit 6ff6bbd

Please sign in to comment.