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,