Last active
October 31, 2023 17:24
-
-
Save lg/9451f3c3b51d02c6d1a00ffa986325f1 to your computer and use it in GitHub Desktop.
A script to provision a new Paperspace machine for gaming
This file contains 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
# init stuff | |
Install-PackageProvider -Name NuGet -Force | |
mkdir c:\cloudygamer\downloads | |
Set-ItemProperty "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" "DontUsePowerShellOnWinX" -Value 0 | |
################ | |
# install steam first since windows updates will take forever (and you can install games) | |
(New-Object System.Net.WebClient).DownloadFile("https://steamcdn-a.akamaihd.net/client/installer/SteamSetup.exe", "c:\cloudygamer\downloads\steamsetup.exe") | |
& "c:\cloudygamer\downloads\steamsetup.exe" /S | Out-Null | |
& "C:\Program Files (x86)\Steam\Steam.exe" # interactive | |
################ | |
# install windows update automation and run it | |
Install-Module PSWindowsUpdate -Force | |
Add-WUServiceManager -ServiceID 7971f918-a847-4430-9279-4a52d1efe18d -Confirm:$false | |
Get-WUInstall -MicrosoftUpdate -AcceptAll -IgnoreReboot -Install -Verbose | |
Restart-Computer -Force | |
##################################### | |
# download latest quadro driver (and install and reboot) | |
$quadroProductIds = @{ | |
"NVIDIA Quadro M4000" = "781" | |
"NVIDIA Quadro P4000" = "840" | |
"NVIDIA Quadro P5000" = "823" | |
"NVIDIA Quadro P6000" = "824" | |
} | |
$device = Get-WmiObject Win32_VideoController | where Name -like "NVIDIA Quadro*" | select Name | |
$quadroPFID = $quadroProductIds[$device.Name] | |
$drivers = (New-Object System.Net.WebClient).DownloadString("http://www.nvidia.com/Download/processFind.aspx?psid=73&pfid=$quadroPFID&osid=74&lid=1&whql=1&lang=en-us&ctk=0") | |
$downloadPageUrl = "https:" + $($drivers -match '<a href=''(//www.nvidia.com/download/driverResults.aspx/(\d+)/en-us)''>' | Out-Null; $Matches[1]) | |
$downloadPage = (New-Object System.Net.WebClient).DownloadString($downloadPageUrl) | |
$driverUrl = "http://us.download.nvidia.com" + $($downloadPage -match 'confirmation.php\?url=(.+?)&' | Out-Null; $Matches[1]) | |
(New-Object System.Net.WebClient).DownloadFile($driverUrl, "c:\cloudygamer\downloads\nvidia.exe") | |
& c:\cloudygamer\downloads\nvidia.exe /s /k | Out-Null # will auto-restart | |
##################################### | |
# show file extensions, hidden items and disable item checkboxes | |
$key = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' | |
Set-ItemProperty $key HideFileExt 0 | |
Set-ItemProperty $key HideDrivesWithNoMedia 0 | |
Set-ItemProperty $key Hidden 1 | |
Set-ItemProperty $key AutoCheckSelect 0 | |
# weird accessibility stuff | |
Set-ItemProperty "HKCU:\Control Panel\Accessibility\StickyKeys" "Flags" "506" | |
Set-ItemProperty "HKCU:\Control Panel\Accessibility\Keyboard Response" "Flags" "122" | |
Set-ItemProperty "HKCU:\Control Panel\Accessibility\ToggleKeys" "Flags" "58" | |
# disable telemetry | |
Set-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" "AllowTelemetry" -Value 0 | |
# dont combine taskbar buttons and no tray hiding stuff | |
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name TaskbarGlomLevel -Value 2 | |
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer" -Name EnableAutoTray -Value 0 | |
# hide the touchbar button on the systray | |
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\PenWorkspace" -Name PenWorkspaceButtonDesiredVisibility -Value 0 | |
# install parsec | |
(New-Object System.Net.WebClient).DownloadFile("https://s3.amazonaws.com/parsec-build/package/parsec-windows.exe", "c:\cloudygamer\downloads\parsec.exe") | |
& c:\cloudygamer\downloads\parsec.exe # you'll need to login and click Start Hosting | |
##################################### | |
# disable windows defender | |
Set-MpPreference -DisableRealtimeMonitoring $true | |
Restart-Computer -Force | |
##################################### | |
# finish disabling windows defender | |
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\WdBoot" -Name Start -Value 4 | |
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\WdFilter" -Name Start -Value 4 | |
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\WdNisDrv" -Name Start -Value 4 | |
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\WdNisSvc" -Name Start -Value 4 | |
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\WinDefend" -Name Start -Value 4 | |
Disable-ScheduledTask -TaskName 'Windows Defender Cleanup' -TaskPath '\Microsoft\Windows\Windows Defender' | |
Disable-ScheduledTask -TaskName 'Windows Defender Scheduled Scan' -TaskPath '\Microsoft\Windows\Windows Defender' | |
Disable-ScheduledTask -TaskName 'Windows Defender Verification' -TaskPath '\Microsoft\Windows\Windows Defender' | |
Disable-ScheduledTask -TaskName 'Windows Defender Cache Maintenance' -TaskPath '\Microsoft\Windows\Windows Defender' | |
# disable UAC | |
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "EnableLUA" -Value 0 | |
# firewall off | |
Set-NetFirewallProfile -Profile Domain,Public,Private -Enabled False | |
# priority to programs, not background | |
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\PriorityControl" -Name "Win32PrioritySeparation" -Value 38 | |
# explorer set to performance | |
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" -Name "VisualFXSetting" -Value 2 | |
# disable crash dump | |
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\CrashControl" -Name "CrashDumpEnabled" -Value 0 | |
# disable some more scheduled tasks | |
Disable-ScheduledTask -TaskName 'ServerManager' -TaskPath '\Microsoft\Windows\Server Manager' | |
Disable-ScheduledTask -TaskName 'ScheduledDefrag' -TaskPath '\Microsoft\Windows\Defrag' | |
Disable-ScheduledTask -TaskName 'ProactiveScan' -TaskPath '\Microsoft\Windows\Chkdsk' | |
Disable-ScheduledTask -TaskName 'Scheduled' -TaskPath '\Microsoft\Windows\Diagnosis' | |
Disable-ScheduledTask -TaskName 'SilentCleanup' -TaskPath '\Microsoft\Windows\DiskCleanup' | |
Disable-ScheduledTask -TaskName 'WinSAT' -TaskPath '\Microsoft\Windows\Maintenance' | |
Disable-ScheduledTask -TaskName 'StartComponentCleanup' -TaskPath '\Microsoft\Windows\Servicing' | |
# disable Windows Update | |
Set-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU" "NoAutoUpdate" 1 | |
Set-ItemProperty "HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\WindowsUpdate\AU" "AUOptions" 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment