Parameters and secrets
Declare task parameters and secrets, then resolve them from arguments, environment variables, user secrets, and workspace configuration.
Entry points
Do.TrailingArguments
Arguments supplied after the -- separator on the task command line.
public static IReadOnlyList<string> TrailingArguments { get; }Property Value
Do.Param(string)
Declares a command-line parameter and resolves its configured value without executing user code during help discovery.
public static OptionalParam<string> Param(string name)Parameters
namestring-
The non-empty configuration key, written as
--name valueon the command line orDOTNETDO_namein the environment.
Returns
Do.Param<T>(string)
Declares an optional typed command-line parameter without a default value.
public static OptionalParam<T> Param<T>(string name) where T : notnullParameters
namestring-
The non-empty configuration key, written as
--name valueon the command line orDOTNETDO_namein the environment.
Returns
Type Parameters
T
Do.Param<T>(string, T, string?)
Declares a command-line parameter and resolves its configured value without executing user code during help discovery.
public static Param<T> Param<T>(string name, T defaultValue, string? description = null) where T : notnullParameters
namestring-
The non-empty configuration key, written as
--name valueon the command line orDOTNETDO_namein the environment. defaultValueT-
The value used when command-line arguments, environment variables, and user secrets do not configure the parameter.
descriptionstring?-
Optional task help text describing the parameter to callers.
Returns
- Param<T>
Type Parameters
T
Do.Secret(string, string?, string?)
Declares a string parameter whose resolved value is registered for log redaction.
public static OptionalSecret Secret(string name, string? defaultValue = null, string? description = null)Parameters
namestring-
The non-empty configuration key, written as
--name valueon the command line orDOTNETDO_namein the environment. defaultValuestring?-
The secret used when no higher-precedence source configures the parameter; null leaves it optional.
descriptionstring?-
Optional task help text that must not reveal the secret value.