Hello, @David Downing !
Changing a drive letter both manually and with a PowerShell script
Thank you for being patient! I tried manually changing the Temporary Storage drive letter but ran into a "Parameter is incorrect" error. This was because I skipped over the prerequisite step of temporarily moving pagefile.sys to C drive like you mentioned. Once I did that, I was able to change the drive letter from D to T successfully both manually and using the PowerShell script:
$Drive = Get-CimInstance -ClassName Win32_Volume -Filter "DriveLetter = 'D:'"
$Drive | Set-CimInstance -Property @{DriveLetter ='T:'}
One of the simplest approaches to scripting pagefile.sys would be:
wmic computersystem set AutomaticManagedPagefile=False
Once that has been completed, restart the VM and the script above to change the temp drive letter will run successfully. @David Downing (thank you!) has used the following to move the pagefile.sys to the temp drive:
wmic pagefileset where name="C:\pagefile.sys" delete
wmic pagefileset create name="T:\pagefile.sys"
wmic pagefileset where name="T:\pagefile.sys" set InitialSize=6144,MaximumSize=6144
Additional pagefile.sys options:
- https://cloudbuild.co.uk/windows-core-move-page-file-via-powershell/
- https://www.tutorialspoint.com/how-to-change-pagefile-settings-using-powershell
- http://tompaps.blogspot.com/2015/01/move-page-file-remotely-os.html