我可以像这样通过WMI修改页面文件设置
- PS D:\> gwmi win32_pagefilesetting
- MaximumSize Name Caption
- ----------- ---- -------
- 8192 c:\pagefile.sys c:\ 'pagefile.sys'
- 8192 d:\pagefile.sys d:\ 'pagefile.sys'
- PS D:\> $pf=gwmi win32_pagefilesetting
- PS D:\> $pf.gettype()
- IsPublic IsSerial Name BaseType
- -------- -------- ---- --------
- True True Object[] System.Array
- PS D:\> $pf[0].InitialSize=4096;$pf[0].MaximumSize=4096
- PS D:\> $pf[0].Put()
- PS D:\> gwmi win32_pagefilesetting
- MaximumSize Name Caption
- ----------- ---- -------
- 4096 c:\pagefile.sys c:\ 'pagefile.sys'
- 8192 d:\pagefile.sys d:\ 'pagefile.sys'