我试图弄清楚我将如何做到这一点.我有一个可以包含多个文件的目录,它们的名称不同,但它们都具有相同的扩展名(.ini).我需要以某种方式,通过他们的扩展名搜索文件,然后依次订购替换每个文件中的内容.现在我想出了如何通过确切名称(而不是扩展名)获取文件并替换它的内容
@powershell -command "(Get-Content ..\Folder\File.ini).replace('TextToBeReplaced',\"NewText1`nNewText2") | Set-Content ..\Folder\File.ini"
Run Code Online (Sandbox Code Playgroud)
我需要改变什么?
powershell ×1