IReadOnlyEnvironmentVariables.TryGetVariable Method

Definition

Tries to get the value of the specified environment variable.

public bool TryGetVariable(string variable, out Microsoft.Testing.Platform.Extensions.TestHostControllers.OwnedEnvironmentVariable? environmentVariable);
abstract member TryGetVariable : string * OwnedEnvironmentVariable -> bool
Public Function TryGetVariable (variable As String, ByRef environmentVariable As OwnedEnvironmentVariable) As Boolean

Parameters

variable
String

The name of the environment variable.

environmentVariable
OwnedEnvironmentVariable

When this method returns, contains the value of the environment variable, if it is found; otherwise, null.

Returns

true if the environment variable is found; otherwise, false.

Applies to