所以每个文件都有一行
发布者="GUID here"
我想用简单的文字"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
}
Run Code Online (Sandbox Code Playgroud)
它仅取代Publisher ="with Publisher ="TEXTHERE"{GUID}"
有什么建议?
我试图找到一种方法来告诉它Publisher ="开始和那之间和下一个之间的一切"
powershell ×1