Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Powershell remoting and page file

I wrote a powershell script that connects to a remote machine with the intent of executing a software rollout on said machine. Basically it connects, maps a drive, copies the rollout from the mapped drive to the target machine, then executes a perl script to install the rollout. If I do those steps manually everything works fine. When I try using my script, the perl script fails on the remote machine saying, "The paging file is too small for this operation to complete".

Can someone explain the considerations I need to take into account when operating remotely? I've tried monitoring memory usage and I don't see anything out of the ordinary. Is the page file OS wide or is there some type of per user configuration my script should be setting when it connects?

I can post snippets of my script if needed, but the script is 426 lines so I think it would be overwhelming to post in its entirety.

like image 976
Justin Holbrook Avatar asked Oct 15 '25 13:10

Justin Holbrook


1 Answers

I found that the remote shells are managed differently than logging onto the box and executing a powershell session. I had to increase the maximum amount of memory available using one of the commands below:

Set-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 1024

winrm set winrm/config @{MaxMemoryPerShellMB="1024"}

The default is 150MB which didn't cut it in my case. I can't say that I recommend 1GB, I'm just a developer. I tried upping it until I found what worked for me.

like image 188
Justin Holbrook Avatar answered Oct 17 '25 09:10

Justin Holbrook



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!