From c209024de067676b4e04dd6e307510e9ebf1aa20 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Fri, 23 Mar 2018 15:55:27 +0100 Subject: [PATCH] Change ErrorActionPreference to Stop --- cleanW10.ps1 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cleanW10.ps1 b/cleanW10.ps1 index 22f1b34..e09fbfb 100755 --- a/cleanW10.ps1 +++ b/cleanW10.ps1 @@ -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 \ No newline at end of file +} \ No newline at end of file