Tag: stringescapeutils

使用C#生成Powershell脚本时转义字符

我使用VS2010,C#,.NET 3.5生成Powershell脚本(ps1文件)。 然后,它是Powershell的必需转义字符。 有关它的任何建议,以开发逃避字符的好方法吗? public static partial class StringExtensions { /* PowerShell Special Escape Sequences Escape Sequence Special Character `n New line `r Carriage Return `t Tab `a Alert `b Backspace `” Double Quote `’ Single Quote “ Back Quote `0 Null */ public static string FormatStringValueForPS(this string value) { if (value == null) return […]