Skip to content

Instantly share code, notes, and snippets.

@trmwzm
Forked from ian-p-cooke/add_wsl_exclusions.ps1
Created November 12, 2022 05:02
Show Gist options
  • Save trmwzm/3a1db23a540a65df5bc182bd800b846e to your computer and use it in GitHub Desktop.
Save trmwzm/3a1db23a540a65df5bc182bd800b846e to your computer and use it in GitHub Desktop.
powershell script to add WSL exclusions
$win_user = "ipc"
$linux_user = "ipc"
$package = "CanonicalGroupLimited.Ubuntu18.04onWindows_79rhkp1fndgsc"
$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