Add-Win-Antivirus-Exclusions Horoscope

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

## Parashar Lite 9 Default installation directory.

Change this if you have


installed in a different location. ##

$PL9InstallationPath = 'C:\GeoVision' #default installation path


Write-Host -ForegroundColor Cyan "Adding Exclusions for the PL9 path
$PL9InstallationPath"

$childPaths = Get-ChildItem -Path $PL9InstallationPath -Recurse -Directory |


Select-Object -ExpandProperty FullName

# Add each path to Defender's exclusion list


foreach ($path in $childPaths)
{
Try
{
Add-MpPreference -ExclusionPath $path -Force -ErrorAction Stop
Write-Host -ForegroundColor Green "Added $path to Windows Defender
exclusions"
}
catch
{
Write-Host -ForegroundColor Magenta "ERROR :: $($_.Exception.Message)"
}
}

# Add Process to Defender Exclusion List


Try
{
Add-MpPreference -ExclusionProcess "PL9.exe" -Force -ErrorAction Stop
Write-Host -ForegroundColor Green "Added Process PL9.exe to Windows Defender
exclusions."
}
catch
{
Write-Host -ForegroundColor Magenta "ERROR :: $($_.Exception.Message)"
}

Write-Host -ForegroundColor Cyan "Script execution completed."

You might also like