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.

Run dotnet Tool

Runs a dotnet tool, optionally ensuring that it is installed.

Script usage:

DotNet::Tool(
	Command: <text>,
	[Arguments: <text>],
	[Global: <true/false>],
	[PackageId: <text>],
	[Version: <text>],
	[PackageSource: <text>],
	[AdditionalArguments: <text>],
	[EnsureDotNetInstalled: <text>],
	[DotNetPath: <text>]
);

Arguments:

NameFormatScript UsageUsage Notes
Command (default)
text
Command
This argument is required.
Arguments
text
Arguments
Global tool
true/false
Global
Package ID
text
PackageId
Version
text
Version
Value note: "latest".
Package source
text
PackageSource
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".

Example:

# Install and run the latest version of dotnetsay locally
DotNet::Tool dotnetsay
(
    Arguments: Hello World!,
    PackageId: dotnetsay
);