How to expand file content with powershell
问题 I want to do this : $content = get-content "test.html" $template = get-content "template.html" $template | out-file "out.html" where template.html contains <html> <head> </head> <body> $content </body> </html> and test.html contains: <h1>Test Expand</h1> <div>Hello</div> I get weird characters in first 2 characters of out.html : �� and content is not expanded. How to fix this ? 回答1: To complement Mathias R. Jessen's helpful answer with a solution that: is more efficient. ensures that the