question

DominiqueDUCHEMIN-4668 avatar image
0 Votes"
DominiqueDUCHEMIN-4668 asked RichMatheisen-8856 commented

Where could I find the module for Set-OSCVirtualMemory?

Hello

Script to configure virtual memory page file size (PowerShell)

Where could I find the Set-OSCVirtualMemory and over powershell commands? all previous link send me to sample page but nothing find it..

Thanks,
Dom

windows-server-powershell
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RichMatheisen-8856 avatar image
1 Vote"
RichMatheisen-8856 answered RichMatheisen-8856 commented

Here's one place: AdjustVirtualMemoryPagingFileSize.psm1
. . . and another: AdjustVirtualMemoryPagingFileSize.zip

There are probably more . . . look for the module name, not the cmdlet name.

Be cautious when running scripts from untrusted sources!


· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello

I was able to download the psm1 file but not the zip it is giving an error cannot be download!!!

Thanks,
Dom

0 Votes 0 ·

You can import the module yourself. No need for the zip file -- it probably just holds the psm1 file. :-)

Here's an example of how to do that.
10006834

But to just import the module, all you need is line #13 of that script (with the right directory name).

1 Vote 1 ·
LimitlessTechnology-2700 avatar image
1 Vote"
LimitlessTechnology-2700 answered

Hello @DominiqueDUCHEMIN,

I am using the next:

To set automatic (let Windows manage the pagefile):
$pagefile = Get-WmiObject Win32_ComputerSystem -EnableAllPrivileges
$pagefile.AutomaticManagedPagefile = $false
$pagefile.put() | Out-Null

To specific the size:

$pagefileset = Get-WmiObject Win32_pagefilesetting
$pagefileset.InitialSize = 1024
$pagefileset.MaximumSize = 2048
$pagefileset.Put() | Out-Null

You can see other methods in this thread: https://social.technet.microsoft.com/Forums/en-US/82fd5a8c-4a6f-4855-95c7-965f5b45c95c/adjust-virtual-memory-paging-file-size?forum=mdt

Hope this helps,
Best regards,

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.