다음을 통해 공유


CodeGeneration.EscapeVariableName(String) Method

Definition

Escapes content so that it is safe for inclusion in a string that will later be used in a variable name reference. This is only valid when used within PowerShell's curly brace naming syntax.

For example: '${' + EscapeVariableName('value') + '}'

public:
 static System::String ^ EscapeVariableName(System::String ^ value);
public:
 static Platform::String ^ EscapeVariableName(Platform::String ^ value);
 static std::wstring EscapeVariableName(std::wstring const & value);
public static string EscapeVariableName (string value);
static member EscapeVariableName : string -> string
Public Shared Function EscapeVariableName (value As String) As String

Parameters

value
String

The content to be included as a variable name.

Returns

Content with all curly braces and back-ticks escaped.

Applies to