I am trying to dump a large string to a text file over the network, but I am only getting around 64kbit per second. Read a bit about different methods to write files and saw examples using Streamwriter that was quite fast, but that was writing to a local file.
Encountered this thread where the recommendation was to increase the buffer size. Does anyone know how to do this in Powershell?
Including the link for reference:
Writing to file using StreamWriter much slower than file copy over slow network
Thanks!
Edit
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
[System.IO.File]::WriteAllLines($PathToFile, $LargeTextMass, $Utf8NoBomEncoding, 0x10000)
Cannot find an overload for "WriteAllLines" and the argument count: "4".
Edit 2:
$Utf8NoBomEncoding = New-Object System.Text.UTF8Encoding $False
$sw = new-object System.IO.StreamWriter "test2.txt", $false, $Utf8NoBomEncoding,0x10000