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.StringThe input string with variables to expand
additionalVariableReplacements
Type: System.Collections.Generic.IDictionary<String, String>A dictionary of addition name value pairs that should be replaced
Return Value
Type: System.String
A string with all environment variables expanded and removed
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.