Change ErrorActionPreference to Stop
This commit is contained in:
parent
fc212fa7ce
commit
c209024de0
1 changed files with 2 additions and 3 deletions
|
@ -3,7 +3,7 @@ Import-Module NetSecurity #Useful to manipulate firewall rules
|
|||
Set-StrictMode -Version 2
|
||||
$HOST_FILE = "$env:windir\System32\drivers\etc\hosts"
|
||||
$HOST_IP = "0.0.0.0"
|
||||
$ErrorActionPreference = "Continue"
|
||||
$ErrorActionPreference = "Stop"
|
||||
$ProgressPreference = "SilentlyContinue"
|
||||
|
||||
#Thanks to https://gist.github.com/markembling/173887
|
||||
|
@ -499,5 +499,4 @@ try {
|
|||
catch {
|
||||
Write-Host -NoNewline -ForegroundColor Red "Error`n`t"
|
||||
Write-Host -ForegroundColor DarkRed $Error[0].Exception.Message
|
||||
}
|
||||
ri
|
||||
}
|
Reference in a new issue