Forked from SynCap/remove_node_modules_recursively.ps1
Created
July 12, 2020 23:49
-
-
Save michaelmcshinsky/fe70cbea1534126fc3e1124f2aba9e87 to your computer and use it in GitHub Desktop.
Remove `node_modules` folders in Windows in all subfolders recursively with PowerShell to avoid exceeding path max_length
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
Note: Eliminate `-WhatIf` parameter to get action be actually done | |
Note: PS with version prior to 4.0 can't delete non-empty folders | |
#> | |
Get-ChildItem -Path "." -Include "node_modules" -Recurse -File:$false | Remove-Item -Recurse -Force -WhatIf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment