# MaxMemoryPerShellMB

**URL:** <https://forums.powershell.org/t/maxmemorypershellmb/849>\
**Category:** PowerShell Help\
**Created:** [December 31, 2011, 6:30pm UTC](https://forums.powershell.org/t/maxmemorypershellmb/849 "2011-12-31T18:30:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![archives](https://avatars.discourse-cdn.com/v4/letter/a/bb73d2/32.png) [@archives](https://forums.powershell.org/u/archives)\
**Post date:** [December 31, 2011, 6:30pm UTC](https://forums.powershell.org/t/maxmemorypershellmb/849/1 "2011-12-31T18:30:00Z")

</div>

by jmp8600 at 2013-04-11 08:14:18

> Hello There,  
>   
> is there a way to find amount of data will be using by executing invoke-commands in PSSession? how do I know which value to set MaxMemoryPerShellMB to? I have a script which work on most servers but every now and then it fails with error wsman error…after increasing MaxMemoryPerShellMB to 300 i don’t see it happening anymore…  
>   
> Thx  
> -hp

by mjolinor at 2013-04-11 08:27:05

> That’s going to depend on the command/script being executed, but probably not.   
>   
> You may need to look at modifying the script to minimize the amount of memory it’s using.

by jmp8600 at 2013-04-11 08:32:11

> well i am just getting properties of IIS like, AppPool configurations, memory limit, .Net version, SSL cofig etc. …why would that take over 150MB of PSSession?

by DonJ at 2013-04-11 08:40:02

> Because the underlying .NET code might be huge.

by jmp8600 at 2013-04-11 09:38:13

> interesting…i just have to shoot arrows in black until i hit the right size…Thx Don.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:57pm UTC](https://forums.powershell.org/t/maxmemorypershellmb/849/2 "2024-05-16T20:57:56Z")

</div>

Closed on May 16, 2024, 8:57pm UTC


