Increase Powershell Memory

Discussion created by Busby on Jul 27, 2016

To any of you writing Powershell to consume data from Qualys you may run into error with out of memory issues in Powershell.  I finally got feed up and determined it was the Powershell process that ran out of memory.


I looked at this link: Learn How to Configure PowerShell Memory | Hey, Scripting Guy! Blog


And using the following steps with and Powershell command prompt with Admin Priv I did these steps.

  1. sl WSMan:\localhost\Shell
  2. dir
  3. Set-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 4096
  4. Restart-Service winrm


This boosted the memory allocated to powershell up to 4GB and then my powershell had no issue consuming large files.  Change is system wide and permanent.


Mileage may vary let me know if anyone has issues.