init 命令 (NuGet CLI)

適用於: 套件建立 • 支援的版本: 3.3+

使用階層式配置,將所有套件從一般資料夾複製到目的地資料夾,如 add 命令所述。 也就是說,using init 相當於在 add 資料夾中的每個套件上使用 命令。

如同 add,目的地必須是本機資料夾或 UNC 路徑;不支援 HTTP 套件存放庫,例如 nuget.org 或私人伺服器。

使用方式

nuget init <source> <destination> [options]

其中 <source> 是包含封裝的資料夾,而 <destination> 是複製封裝的本機資料夾或 UNC 路徑名稱。

選項。

  • -ConfigFile

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

  • -Expand

    將每個已新增至封裝來源的套件中的所有檔案加入;與 -Expandadd 命令相同。

  • -ForceEnglishOutput

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

  • -?|-help

    顯示命令的說明資訊。

  • -NonInteractive

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

  • -Verbosity [normal|quiet|detailed]

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

另請參閱 環境變數

範例

nuget init c:\foo c:\bar
nuget init \\foo\packages \\bar\packages -Expand