Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Function Uninstall-NpmPackagesInDirectory {
- Param (
- # Optional path to node_modules directory
- [String]$pathToNodeModules = (Get-Item -Path ".\node_modules").FullName
- )
- # Loop over each folder in the directory
- ForEach ($dep in Get-ChildItem -Path $pathToNodeModules | ? { $_.FullName -notmatch ".bin" }) {
- # Uninstall the package
- iex "npm uninstall $dep"
- #iex "echo $dep"
- }
- }
- #Uninstall-NpmPackagesInDirectory
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement