Advertisement
Guest User

Untitled

a guest
Aug 1st, 2015
205
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. Function Uninstall-NpmPackagesInDirectory {
  2. Param (
  3. # Optional path to node_modules directory
  4. [String]$pathToNodeModules = (Get-Item -Path ".\node_modules").FullName
  5. )
  6.  
  7. # Loop over each folder in the directory
  8. ForEach ($dep in Get-ChildItem -Path $pathToNodeModules | ? { $_.FullName -notmatch ".bin" }) {
  9. # Uninstall the package
  10. iex "npm uninstall $dep"
  11. #iex "echo $dep"
  12. }
  13. }
  14.  
  15. #Uninstall-NpmPackagesInDirectory
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement