Skip to content

Instantly share code, notes, and snippets.

@AlbertoMonteiro
Created November 1, 2017 18:57
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlbertoMonteiro/bd515d5846786c59e540d1c5ffe44d4f to your computer and use it in GitHub Desktop.
Save AlbertoMonteiro/bd515d5846786c59e540d1c5ffe44d4f to your computer and use it in GitHub Desktop.
Remover arquivos com powershell
[regex]$reg = "(?<name>.+?)(\.\d+){3,4}\.nupkg$";
ls *.nupkg | sort -Descending | group { $reg.Match($_.Name).Groups["name"].Value } | where { $_.count -gt 1 } | % { $_.group | select -Skip 5 } | del
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment