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 Set-StrictMode -Version 2
$HOST_FILE = "$env:windir\System32\drivers\etc\hosts" $HOST_FILE = "$env:windir\System32\drivers\etc\hosts"
$HOST_IP = "0.0.0.0" $HOST_IP = "0.0.0.0"
$ErrorActionPreference = "Continue" $ErrorActionPreference = "Stop"
$ProgressPreference = "SilentlyContinue" $ProgressPreference = "SilentlyContinue"
#Thanks to https://gist.github.com/markembling/173887 #Thanks to https://gist.github.com/markembling/173887
@ -500,4 +500,3 @@ catch {
Write-Host -NoNewline -ForegroundColor Red "Error`n`t" Write-Host -NoNewline -ForegroundColor Red "Error`n`t"
Write-Host -ForegroundColor DarkRed $Error[0].Exception.Message Write-Host -ForegroundColor DarkRed $Error[0].Exception.Message
} }
ri