-
-
Save dazinator/172b5c6f365274e4d31bd3e49a89b913 to your computer and use it in GitHub Desktop.
Unlist all versions of a NuGet package
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
choco install nuget.commandline | |
$PackageId = "xxx" | |
$ApiKey = "yyy" | |
$json = Invoke-WebRequest -Uri "https://api.nuget.org/v3-flatcontainer/$PackageId/index.json" | ConvertFrom-Json | |
foreach($version in $json.versions) | |
{ | |
Write-Host "Unlisting $PackageId, Ver $version" | |
Invoke-Expression "nuget.exe delete $PackageId $version $ApiKey -source https://api.nuget.org/v3/index.json -NonInteractive" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment