list 命令 (NuGet CLI)

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

顯示來自指定來源的套件清單。 如果未指定任何來源,則會使用全域組態檔 %AppData%\NuGet\NuGet.Config (Windows) 或 ~/.nuget/NuGet/NuGet.Config中定義的所有來源。 如果 NuGet.Config 未指定任何來源,則 list 使用預設摘要 (nuget.org)。

使用方式

nuget list [search terms] [options]

其中選擇性搜尋字詞會篩選顯示的清單。 搜尋字詞 會套用至封裝、標記和套件描述的名稱,就像在 nuget.org 上使用它們一樣。

選項。

  • -AllVersions

    列出套件的所有版本。 根據預設,只會顯示最新的套件版本。

  • -ConfigFile

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

  • -ForceEnglishOutput

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

  • -?|-help

    顯示命令的說明資訊。

  • -IncludeDelisted

    (3.2+) 顯示未列出的套件。

  • -NonInteractive

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

  • -PreRelease

    在清單中包含發行前版本套件。

  • -Source

    要搜尋的套件來源。 您可以使用 選項多次指定多個來源 -Source

  • -Verbosity [normal|quiet|detailed]

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

另請參閱 環境變數

範例

列出來自已設定摘要的所有套件:

nuget list

列出具有詳細詳細資訊的 Azure 相關套件:

nuget list Azure -Verbosity detailed

列出所有來自已設定摘要的 Azure 相關套件版本:

nuget list Azure -AllVersions

列出來自指定來源/摘要的所有 JSON 相關套件版本:

nuget list JSON -AllVersions -Source "https://nuget.org/api/v2"

列出多個來源/摘要中的 JSON 相關套件:

nuget list JSON -Source "https://nuget.org/api/v2" -Source "https://other-feed-url-goes-here"