dotnet nuget deletedotnet nuget delete

本主題適用於:✓ .NET Core 1.x SDK .NET Core 2.x SDKThis topic applies to: ✓ .NET Core 1.x SDK .NET Core 2.x SDK

名稱Name

dotnet nuget delete - 從伺服器刪除或取消列出套件。dotnet nuget delete - Deletes or unlists a package from the server.

概要Synopsis

dotnet nuget delete [<PACKAGE_NAME> <PACKAGE_VERSION>] [--force-english-output] [--interactive] [-k|--api-key] [--no-service-endpoint]
    [--non-interactive] [-s|--source]
dotnet nuget delete [-h|--help]

說明Description

dotnet nuget delete 命令會從伺服器刪除或取消列出套件。The dotnet nuget delete command deletes or unlists a package from the server. 對於 nuget.org,該動作是取消列出套件。For nuget.org, the action is to unlist the package.

引數Arguments

  • PACKAGE_NAME

    要刪除的套件名稱/識別碼。Name/ID of the package to delete.

  • PACKAGE_VERSION

    要刪除的套件版本。Version of the package to delete.

選項Options

  • --force-english-output

    強制使用非變異英文文化特性來執行應用程式。Forces the application to run using an invariant, English-based culture.

  • -h|--help

    印出命令的簡短說明。Prints out a short help for the command.

  • --interactive

    允許命令進行封鎖及要求對驗證之類的作業採取手動動作。Allows the command to block and requires manual action for operations like authentication. 自 .NET Core 2.2 SDK 起可用的選項。Option available since .NET Core 2.2 SDK.

  • -k|--api-key <API_KEY>

    伺服器的 API 金鑰。The API key for the server.

  • --no-service-endpoint

    不會將 "api/v2/package" 附加至來源 URL。Doesn't append "api/v2/package" to the source URL. 自 .NET Core 2.1 SDK 起可用的選項。Option available since .NET Core 2.1 SDK.

  • --non-interactive

    不提示使用者輸入或確認。Doesn't prompt for user input or confirmations.

  • -s|--source <SOURCE>

    指定伺服器 URL。Specifies the server URL. 支援的 nuget.org URL 包括 https://www.nuget.orghttps://www.nuget.org/api/v3https://www.nuget.org/api/v2/packageSupported URLs for nuget.org include https://www.nuget.org, https://www.nuget.org/api/v3, and https://www.nuget.org/api/v2/package. 對於私用摘要,請取代主機名稱 (例如,%hostname%/api/v3)。For private feeds, replace the host name (for example, %hostname%/api/v3).

範例Examples

  • 刪除 Microsoft.AspNetCore.Mvc 套件 1.0 版:Deletes version 1.0 of package Microsoft.AspNetCore.Mvc:

    dotnet nuget delete Microsoft.AspNetCore.Mvc 1.0
    
  • 刪除 Microsoft.AspNetCore.Mvc 套件 1.0 版,不提示使用者輸入認證或其他輸入:Deletes version 1.0 of package Microsoft.AspNetCore.Mvc, not prompting user for credentials or other input:

    dotnet nuget delete Microsoft.AspNetCore.Mvc 1.0 --non-interactive