delete 命令 (NuGet CLI)

適用於: 套件發佈 • 支援的版本: 全部

從封裝來源刪除或取消列出套件。 針對 nuget.org,delete 命令 會將套件取消列出。

使用方式

nuget delete <packageID> <packageVersion> [options]

其中 <packageID><packageVersion> 識別要刪除或取消列出的確切套件。 確切的行為取決於來源。 例如,針對本機資料夾,會刪除封裝;針對 nuget.org 未列出套件。

選項。

  • -ApiKey

    目標存放庫的 API 金鑰。 如果沒有,則會使用組態檔中指定的組態檔。

  • -ConfigFile

    要套用的 NuGet 組態檔。 如果未指定, %AppData%\NuGet\NuGet.Config 則會使用 (Windows) 或 ~/.nuget/NuGet/NuGet.Config~/.config/NuGet/NuGet.Config (Mac/Linux)。

  • -ForceEnglishOutput

    (3.5+) 強制nuget.exe使用非變異的英文文化特性來執行。

  • -?|-help

    顯示命令的說明資訊。

  • -NonInteractive

    隱藏使用者輸入或確認的提示。

  • -np|-NoPrompt

    刪除時不要提示。

  • -NoServiceEndpoint 不會將 「api/v2/packages」 附加至來源 URL。

  • -src|-Source

    指定伺服器 URL。 nuget.org 的網址為 https://api.nuget.org/v3/index.json。 針對私人摘要,請取代主機名,例如 %hostname%/api/v3

  • -Verbosity [normal|quiet|detailed]

    指定輸出中顯示的詳細資料量: normal (預設值), quietdetailed

另請參閱 環境變數

範例

nuget delete MyPackage 1.0

nuget delete MyPackage 1.0 -Source http://package.contoso.com/source -apikey A1B2C3