Powershell - 将大量文本写入文件的最快方法

Dan*_*ral 4 powershell

就运行时性能而言,在 powershell 中将大量文本写入文件的最快方法是什么?

Dav*_*ant 6

$sw = new-object system.IO.StreamWriter(<my file path>)
$sw.write(<my large body of text>)
$sw.close()
Run Code Online (Sandbox Code Playgroud)