diff --git a/.gitignore b/.gitignore index 7040945..1c286eb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ SkipList.txt ProtectList.txt IncludeList.txt +ExcludePaths.txt \ No newline at end of file diff --git a/DeployCryptoBlocker.ps1 b/DeployCryptoBlocker.ps1 index 8ca23d4..3465b8a 100644 --- a/DeployCryptoBlocker.ps1 +++ b/DeployCryptoBlocker.ps1 @@ -305,10 +305,15 @@ $drivesContainingShares | ForEach-Object { } # Add Folder Exceptions from ExcludeList.txt -If (Test-Path .\ExcludePaths.txt) { - Write-Host "`n####" - Write-Host "Processing Folder Exclusions.." - Get-Content .\ExcludePaths.txt | ForEach-Object { +Write-Host "`n####" +Write-Host "Processing ExcludeList.." +### move file from C:\Windows\System32 or whatever your relative path is to the directory of this script +if (Test-Path .\ExcludePaths.txt) +{ + Move-Item -Path .\ExcludePaths.txt -Destination $PSScriptRoot\ExcludePaths.txt -Force +} +If (Test-Path $PSScriptRoot\ExcludePaths.txt) { + Get-Content $PSScriptRoot\ExcludePaths.txt | ForEach-Object { If (Test-Path $_) { # Build the argument list with all required fileGroups $ExclusionArgs = 'Exception', 'Add', "/Path:$_"