我输入了这个:
$folder = 'c:\test'
"c:\test" -replace $folder ""
但得到这个错误:
在 line:1 char:25 + "c:\test" -replace $folder "" + ~~ Unexpected token '""' 在表达式或语句中。 + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException +fullyQualifiedErrorId : UnexpectedToken
这对我没有帮助How to handle backslash character in PowerShell -replace string operations?
您缺少一个逗号,我认为您的输入字符串和搜索字符串向后。
$folder -replace "test",""
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句