本帖最后由 smss 于 2019-7-14 15:53 编辑
- $str = [IO.File]::ReadAllText('manifest.xml', [Text.Encoding]::UTF8);
- $str = $str -replace '(?m)^\s+|\s*(?:\n|$)' -replace '<!--(?:(?!-->).)*-->';
- [IO.File]::WriteAllText('1.xml', $str, [Text.Encoding]::UTF8);
- $MyFile = Get-Content '1.xml'
- $Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
- [System.IO.File]::WriteAllLines('1.xml', $MyFile, $Utf8NoBomEncoding)
复制代码 感觉能再改改 |