如何通过PowerShell设置Windows(pagefile.sys)页面文件的大小?
发布于 2016-06-14 21:36:51
下面是通过PowerShell更新pagefile.sys大小的方法:
# PowerShell Script to set the size of pagefile.sys
$computersys = Get-WmiObject Win32_ComputerSystem -EnableAllPrivileges;
$computersys.AutomaticManagedPagefile = $False;
$computersys.Put();
$pagefile = Get-WmiObject -Query "Select * From Win32_PageFileSetting Where Name like '%pagefile.sys'";
$pagefile.InitialSize = <New_Value_For_Size_In_MB>;
$pagefile.MaximumSize = <New_Value_For_Size_In_MB>;
$pagefile.Put();如下所示执行脚本:
PS> .\update_pagefile_size.ps1;https://stackoverflow.com/questions/37813441
复制相似问题