Skip to content

Instantly share code, notes, and snippets.

View chan4lk's full-sized avatar
🏠
Working from home

Chandima Ranaweera chan4lk

🏠
Working from home
View GitHub Profile
@chan4lk
chan4lk / remove_node_modules_recursively.ps1
Created August 12, 2020 03:17 — forked from SynCap/remove_node_modules_recursively.ps1
Remove `node_modules` folders in Windows in all subfolders recursively with PowerShell to avoid exceeding path max_length
<#
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