CommandExtensions.Invoke Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Invoke(Command, String, IConsole) |
Parses and invokes a command. |
Invoke(Command, String[], IConsole) |
Parses and invokes a command. |
Invoke(Command, String, IConsole)
Parses and invokes a command.
public static int Invoke (this System.CommandLine.Command command, string commandLine, System.CommandLine.IConsole? console = default);
static member Invoke : System.CommandLine.Command * string * System.CommandLine.IConsole -> int
<Extension()>
Public Function Invoke (command As Command, commandLine As String, Optional console As IConsole = Nothing) As Integer
Parameters
- command
- Command
The command to invoke.
- commandLine
- String
The command line to parse.
- console
- IConsole
The console to which output is written during invocation.
Returns
The exit code for the invocation.
Remarks
The command line string input will be split into tokens as if it had been passed on the command line.
Applies to
Invoke(Command, String[], IConsole)
Parses and invokes a command.
public static int Invoke (this System.CommandLine.Command command, string[] args, System.CommandLine.IConsole? console = default);
static member Invoke : System.CommandLine.Command * string[] * System.CommandLine.IConsole -> int
<Extension()>
Public Function Invoke (command As Command, args As String(), Optional console As IConsole = Nothing) As Integer
Parameters
- command
- Command
The command to invoke.
- args
- String[]
The arguments to parse.
- console
- IConsole
The console to which output is written during invocation.
Returns
The exit code for the invocation.