Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Powershell - Fastest way to write large body of text to a file

Tags:

powershell

In terms of runtime performance, which is the fastest method in powershell to write a large body of text into a file?

like image 929
Daniel PP Cabral Avatar asked Sep 11 '25 10:09

Daniel PP Cabral


1 Answers

$sw = new-object system.IO.StreamWriter(<my file path>)
$sw.write(<my large body of text>)
$sw.close()
like image 199
David Brabant Avatar answered Sep 13 '25 08:09

David Brabant