-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathreset_gpu.ps1
More file actions
22 lines (20 loc) · 735 Bytes
/
reset_gpu.ps1
File metadata and controls
22 lines (20 loc) · 735 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
[CmdletBinding()]
param(
[Parameter(Mandatory=$false)]
[Switch]$NoRestart
)
Add-Type -AssemblyName PresentationCore,PresentationFramework
$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
if($currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) -eq $false){
[System.Windows.MessageBox]::Show('Must run {0} as admin' -f $PSCommandPath)
} else {
Push-Location $PSScriptRoot
# Reset to stock GPU settings to avoid crash after resetting power play table
OverdriveNTool -c0"stock w/ fan curve"
reg import delete_power_play.reg
if($NoRestart -eq $false)
{
restart64 /q
}
Pop-Location
}