我在 PowerShell 中有一个变量,其中包含特殊字符,例如“<”、“>”和双引号。目前我正在使用类似-replace ">" , "^>", -replace "<" , "^<",的东西-replace '"' , "'"。有没有办法转义该变量中的所有特殊字符?
-replace ">" , "^>"
-replace "<" , "^<"
-replace '"' , "'"
powershell escaping
escaping ×1
powershell ×1