Skip to content

Instantly share code, notes, and snippets.

@mattdsteele
Forked from ian-p-cooke/add_wsl_exclusions.ps1
Created October 23, 2018 03:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattdsteele/7e1bb579c56b0072da481d515a8f7bac to your computer and use it in GitHub Desktop.
Save mattdsteele/7e1bb579c56b0072da481d515a8f7bac to your computer and use it in GitHub Desktop.
powershell script to add WSL exclusions
$win_user = "matt"
$linux_user = "matt"
$package = "TheDebianProject.DebianGNULinux_76v4gfsz19hv4"
$base_path = "C:\Users\" + $win_user + "\AppData\Local\Packages\" + $package + "\LocalState\rootfs"
$dirs = @("\bin", "\sbin", "\usr\bin", "\usr\sbin", "\home\" + $linux_user + "\.cargo\bin")
$dirs | ForEach { Add-MpPreference -ExclusionProcess ($base_path + $_ + "\*") }
Add-MpPreference -ExclusionPath $base_path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment