Skip to content

Instantly share code, notes, and snippets.

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 brunomartinspro/833bf8fdbe7c8a8f75b9fd91edb64079 to your computer and use it in GitHub Desktop.
Save brunomartinspro/833bf8fdbe7c8a8f75b9fd91edb64079 to your computer and use it in GitHub Desktop.
Delete Nuget Cache using Powershell
$Regex = "PROJECTNAME*."
$Path = "$env:LOCALAPPDATA\NuGet"
Get-ChildItem "$Path" -Recurse | Where{$_.Name -Match "$Regex"} | Remove-Item -Recurse -Verbose
Write-Output("Cleaned: $Path")
$Path = "C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\"
Get-ChildItem "$Path" -Recurse | Where{$_.Name -Match "$Regex"} | Remove-Item -Recurse -Verbose
Write-Output("Cleaned: $Path")
$Path = "$env:USERPROFILE\.nuget\packages\"
Get-ChildItem "$Path" -Recurse -Verbose | Where{$_.Name -Match "$Regex"} | Remove-Item -Recurse -Verbose
Write-Output("Cleaned: $Path")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment