IReadOnlyEnvironmentVariables.TryGetVariable 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.
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.