【发布时间】:2017-05-14 15:13:02
【问题描述】:
我需要一个在 XML 文件中搜索 <?xml version="1.0" encoding="UTF-8"?> 并将其删除的 PowerShell 脚本。
我试过了:
(Get-Content $file) |
Foreach { $_ -Replace '<?xml version="1.0" encoding="UTF-8"?>', "" } |
Set-Content $file;
但它不起作用。
【问题讨论】:
标签: xml powershell replace