Internet Explorer is no longer supported. Many things will still work, but your experience will be degraded and some things won't function. Please use a modern browser such as Edge, Chrome, or Firefox.

Restore NuGet Packages

Restores all packages in a specified solution, project, or packages.config file.

Script usage:

NuGet::Restore-Packages(
	[Target: <text>],
	[PackagesDirectory: <text>],
	[Source: <text>],
	[NuGetExePath: <text>],
	[PreferNuGetExe: <true/false>],
	[AdditionalArguments: <text>],
	[EnsureDotNetInstalled: <text>],
	[DotNetPath: <text>]
);

Arguments:

NameFormatScript UsageUsage Notes
Target
text
Target
The target solution, project, or packages.config file used to restore packages, or directory containing a solution. Value note: "$WorkingDirectory".
Packages directory
text
PackagesDirectory
Value note: "default".
Package source
text
Source
If specified, this NuGet package source will be used to restore packages.
NuGet.exe path
text
NuGetExePath
Full path to NuGet.exe on the target server. When not set, the included nuget.exe will be used. This will only be used if dotnet is not available on a Windows server or PreferNuGetExe is set to true. Default value is "$NuGetExePath".
Prefer NuGet.exe
true/false
PreferNuGetExe
When true, NuGet.exe will be used when run on Windows if it is available, even if dotnet is also available.
Additional arguments
text
AdditionalArguments
Ensure dotnet installed
text
EnsureDotNetInstalled
This uses Microsoft's dotnet-install script to ensure that the specified version is installed. Values other than "auto" will be passed to the Channel parameter. The "auto" value will attempt to determine the SDK your project uses and ensure that it is installed. Value note: "not set (do not install)".
dotnet path
text
DotNetPath
Full path of dotnet.exe (or dotnet on Linux). This is usually C:\Program Files\dotnet\dotnet.exe on Windows. If no value is supplied, the operation will default to %PROGRAMFILES%\dotnet\dotnet.exe for Windows and dotnet (from the path) on Linux. Value note: "default".