Friday, September 23, 2016

Another Way of Managing Page File From PowerShell

Hi folks,

In one of my previous posts I shared with you how to use PowerShell to configure virtual memory on your server.

However lately I have found another nicer way of managing paging file on your server by means of this Page File Module which you can download from MS TechNet gallery.

Before using commands from page file management module you will need to unzip it to a folder, let's call it C:\PowerShell\PageFile. After this you will need to load this module to your PowerShell session as below:

cd C:\PowerShell\PageFile
Import-Module .\AdjustVirtualMemoryPagingFileSize\AdjustVirtualMemoryPagingFileSize.psm1

This module has the following 2 commands:



You will need the Set-OSCVirtualMemory cmdlet that is the part of this module to configure size and location of the paging file.

To configure paging file of the size of 16GB+10MB on the drive C you will need to run the following command:

Set-OSCVirtualMemory -InitialSize 16394 -MaximumSize 16394 -DriveLetter "C:"

Enjoy!