From 08f643e0c7b1be518bc5391c53e5b83361c567bd Mon Sep 17 00:00:00 2001 From: Roman Shevchenko Date: Tue, 3 Sep 2024 11:25:15 +0200 Subject: [PATCH] [platform] skipping invalid patterns when processing the Defender exclusion list; improving diagnostics (IJPL-37118) GitOrigin-RevId: 44068fea0f2e12f8dc66169638734fa47a1f0a3d --- bin/win/defender-exclusions.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/win/defender-exclusions.ps1 b/bin/win/defender-exclusions.ps1 index 36d7acdb172e..d643bd31ca9c 100644 --- a/bin/win/defender-exclusions.ps1 +++ b/bin/win/defender-exclusions.ps1 @@ -29,6 +29,7 @@ try { } } catch [System.Management.Automation.ItemNotFoundException] { } catch [System.Management.Automation.DriveNotFoundException] { + } catch [System.Management.Automation.WildcardPatternException] { } } @@ -51,7 +52,7 @@ try { Set-MpPreference -ExclusionPath $exclusions } catch { - Write-Host $_.Exception.Message + Write-Host "$($_.Exception.GetType()): $($_.Exception.Message)" Write-Host $_.ScriptStackTrace exit 1 }