From 1056533244ca286ce80def95dadf9e6e7e669269 Mon Sep 17 00:00:00 2001 From: Violet Date: Wed, 17 Jan 2024 22:25:22 +0200 Subject: [PATCH] Added error handing to Test-Path --- .../Main files/Core/Protect-WindowsSecurity.psm1 | 1 + Harden-Windows-Security.ps1 | 1 + 2 files changed, 2 insertions(+) diff --git a/Harden-Windows-Security Module/Main files/Core/Protect-WindowsSecurity.psm1 b/Harden-Windows-Security Module/Main files/Core/Protect-WindowsSecurity.psm1 index 1cb736b13..e47d41bf0 100644 --- a/Harden-Windows-Security Module/Main files/Core/Protect-WindowsSecurity.psm1 +++ b/Harden-Windows-Security Module/Main files/Core/Protect-WindowsSecurity.psm1 @@ -363,6 +363,7 @@ Function Protect-WindowsSecurity { 'Import-Module:Verbose' = $false 'Copy-Item:Force' = $true 'Copy-Item:ProgressAction' = 'SilentlyContinue' + 'Test-Path:ErrorAction' = 'SilentlyContinue' } } diff --git a/Harden-Windows-Security.ps1 b/Harden-Windows-Security.ps1 index d2ba787d1..0896cd522 100644 --- a/Harden-Windows-Security.ps1 +++ b/Harden-Windows-Security.ps1 @@ -363,6 +363,7 @@ Function Protect-WindowsSecurity { 'Import-Module:Verbose' = $false 'Copy-Item:Force' = $true 'Copy-Item:ProgressAction' = 'SilentlyContinue' + 'Test-Path:ErrorAction' = 'SilentlyContinue' } }