Change ErrorActionPreference to Stop

This commit is contained in:
Yorick Barbanneau 2018-03-23 15:55:27 +01:00
parent fc212fa7ce
commit c209024de0

View file

@ -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
}