Skip to content

Instantly share code, notes, and snippets.

View idiotandrobot's full-sized avatar

Michael Phillips idiotandrobot

View GitHub Profile
@idiotandrobot
idiotandrobot / Clear-NuGet-Cache.ps1
Last active December 22, 2018 16:53 — forked from thoemmi/Clear-NuGetCache.ps1
Script to delete old NuGet packages from the default global packages folder which haven't been accessed for 150 days
[CmdletBinding(SupportsShouldProcess=$True)]
Param(
[int]$CutoffDays = 150
)
$cutoffDate = (Get-Date).AddDays(-$CutoffDays)
# get path to cached NuGet packages
$nugetCachePath = .\Get-Nuget-Cache-Path.ps1