3 ms·
Unless you also write things to the pipeline via -PassThru specifying -OutFile will read in 10K chunks and write them to the file. No memory apart from that buf
by ygra 10y ago
Unless you also write things to the pipeline via -PassThru specifying -OutFile will read in 10K chunks and write them to the file. No memory apart from that buffer is used. Look at the source, it's public. My PowerShell instance uses 38 MiB of memory the whole time during the download, regardless of the file size.
- setq 10y agoWhat's in your $PSVersionTable? I'm doing this on windows 2008 server.
- ygra 10y ago5.1 on Windows 10. Admittedly, I never really tried iwr on older versions. Heck, the last time I tried downloading something with PowerShell to a file I went the WebClient.DownloadFile route, so it's been a while. You can probably install a more recent version of WinRM on that machine, though (or by now probably the open-source version of PowerShell).