Member-only story

Four Methods to Configure Maximum PowerShell Memory in Windows Server

Fine-Tuning PowerShell for Enhanced Performance: Configuring MaxMemoryPerShellMB in Windows Server

Luca Berton
4 min readOct 30, 2023

Introduction

Windows Server administrators often need to configure various parameters to optimize PowerShell session performance and resource allocation. One such critical parameter is the MaxMemoryPerShellMB, which determines the maximum memory allocated to each PowerShell session. This article will explore multiple methods to configure the MaxMemoryPerShellMB setting.

Method 1: Using PowerShell Command Line Interface

The most straightforward way to configure MaxMemoryPerShellMB is through PowerShell itself. Follow these steps:

  1. Open a PowerShell command line interface.
  2. Navigate to the WSMan Shell configuration by using the sl (Set-Location) and dir (Get-Item) commands:
PS C:\> sl WSMan:\localhost\Shell 
PS WSMan:\localhost\Shell> dir
  1. Locate the MaxMemoryPerShellMB setting in the configuration. It should be displayed along with its current value.
  2. To set a new value, use the Set-Item command:

--

--

Luca Berton
Luca Berton

Written by Luca Berton

I help creative Automation DevOps, Cloud Engineer, System Administrator, and IT Professional to succeed with Ansible Technology to automate more things everyday

No responses yet