Share via


BuildCommonUtil.ExpandEnvironmentVariables Method (String, IDictionary<String, String>)

Expands environment variables which are of the format '$(...)' where the '...' part of the string is any valid combination of letters and numbers. Any patterns recognized as environment variables which do not expand to an existing variable in the current environment are matched with the keys in the string dictionary and replaced with the dictionaries value. If a pattern does not match an environment variable or a key in the dictionary it is left as-is in the output path.

Namespace:  Microsoft.TeamFoundation.Build.Common
Assembly:  Microsoft.TeamFoundation.Build.Common (in Microsoft.TeamFoundation.Build.Common.dll)

Syntax

'Declaration
Public Shared Function ExpandEnvironmentVariables ( _
    inputValue As String, _
    additionalVariableReplacements As IDictionary(Of String, String) _
) As String
public static string ExpandEnvironmentVariables(
    string inputValue,
    IDictionary<string, string> additionalVariableReplacements
)
public:
static String^ ExpandEnvironmentVariables(
    String^ inputValue, 
    IDictionary<String^, String^>^ additionalVariableReplacements
)
static member ExpandEnvironmentVariables : 
        inputValue:string * 
        additionalVariableReplacements:IDictionary<string, string> -> string
public static function ExpandEnvironmentVariables(
    inputValue : String, 
    additionalVariableReplacements : IDictionary<String, String>
) : String

Parameters

  • inputValue
    Type: System.String

    The input string with variables to expand

Return Value

Type: System.String
A string with all environment variables expanded and removed

.NET Framework Security

See Also

Reference

BuildCommonUtil Class

ExpandEnvironmentVariables Overload

Microsoft.TeamFoundation.Build.Common Namespace