我在文件中有以下字符串:
application=\"MyApp\"
,我想用PowerShell命令将其删除(或替换为”。
我尝试了一下,但是没用:
powershell -Command "Get-ChildItem -Path ./Transform\*.json -recurse | ForEach {If (Get-Content $_.FullName | Select-String -Pattern ' where useraction.application=\\\"MyApp\\\"') {(Get-Content $_ | ForEach {$_ -replace ' where useraction.application=\\\"MyApp\\\"', ' '}) | Set-Content $_ -encoding UTF8}}"
我认为在每个特殊字符前面加一个反斜杠是可行的,但到目前为止没有运气。