【发布时间】:2018-03-20 21:17:32
【问题描述】:
所以每个文件都有一行
Publisher="此处为 GUID"
我想用简单的文本“TEXTHERE”(带引号)替换所有 guid (Powershell)
这是我简化的;
`
enter code here`$list = Get-ChildItem -Path:'C:\AppOutput\*allfiles.xml*' -Recurse
$replacestring = 'APPXSIGNCERTIFICATE'
$appxmltest = 'C:\AppOutput\app.xml'
ForEach ($file in $list)
{
(Get-Content $file) -replace "Publisher=""`*", 'Publisher="TEXTHERE"' | Set-Content c:\test2.xml
}
它仅将 Publisher=" 替换为 Publisher="TEXTHERE"{GUID}"
有什么建议吗?
我试图找到一种方法来告诉它 Publisher=" 开始,以及介于它和下一个 " 之间的所有内容
【问题讨论】:
标签: powershell