Skip to content

Commit

Permalink
Fixed relative path bug in ExcludePath.txt (nexxai#59)
Browse files Browse the repository at this point in the history
* Extended functionality and polished ouput

- added the notification options to the template
- removed notification options from the file screen
- added active/passiv screen type configuration
- added german translation to the notification messages
- output polished a bit ;-)
- added a few more comments

* changed default language to english

* changed default type to active

* Changed SkipList from relative Path to automatic detected Path of the Script

* Changed relative path to $PSScriptRoot Variable

  * Always use correct path for included files
  * Ignore working directory
  * works with task scheduler (does not write to Windows System root!)
  * Included files are always in the directory of the script
  * existing files in relative path will be moved to the script path if
  they exist

* fixed bug in skiplist moveing

* Change relative path of ExcludePath.txt to $PSScriptRoot and added ExcludePath to .gitignore
  • Loading branch information
andi-blafasl authored and nexxai committed Oct 10, 2018
1 parent 70b013f commit 3596f7c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
SkipList.txt
ProtectList.txt
IncludeList.txt
ExcludePaths.txt
13 changes: 9 additions & 4 deletions DeployCryptoBlocker.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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:$_"
Expand Down

0 comments on commit 3596f7c

Please sign in to comment.