Created
July 28, 2016 18:35
-
-
Save Hexalon/59b158141bda65375897da8cb39af91d to your computer and use it in GitHub Desktop.
Enables the automatic managed page file for all drives
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.NOTES | |
=========================================================================== | |
Created with: SAPIEN Technologies, Inc., PowerShell Studio 2016 v5.2.124 | |
Created on: 7/28/2016 13:29 | |
Created by: Colin Squier <[email protected] | |
Filename: Enable-AutomaticManagedPageFile.ps1 | |
=========================================================================== | |
.DESCRIPTION | |
Enables the automatic managed page file for all drives. | |
#> | |
[CmdletBinding()] | |
Param () | |
#Configure page file | |
$PageFileInfo = Get-WmiObject -Class Win32_ComputerSystem -EnableAllPrivileges | |
$PageFile = $PageFileInfo.AutomaticManagedPageFile | |
if ($PageFile -eq $false) | |
{ | |
Write-Verbose -Message "The system is currently not using an automatically managed page file. Enabling." | |
$PageFileInfo.AutomaticManagedPageFile = $true | |
[Void]$PageFileInfo.Put() | |
} | |
else | |
{ | |
Write-Verbose -Message "The system is currently using an automatically managed page file." | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment