Share via

Where could I find the module for Set-OSCVirtualMemory?

Dominique DUCHEMIN 836 Reputation points
2021-09-18T02:56:40.853+00:00

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 for business | Windows Server | User experience | PowerShell
0 comments No comments

2 answers

Sort by: Most helpful
  1. Limitless Technology 40,101 Reputation points
    2021-09-20T11:50:04.677+00:00

    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,

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

  2. Rich Matheisen 48,116 Reputation points
    2021-09-18T14:29:31.573+00:00

    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!

    Was this answer helpful?

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.