working on my laptop with 1650 maxq
This commit is contained in:
19
disableGPU.ps1
Normal file
19
disableGPU.ps1
Normal file
@@ -0,0 +1,19 @@
|
||||
# Function to check if the script is running as Administrator
|
||||
function Test-Administrator {
|
||||
$currentUser = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
|
||||
$currentUser.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
|
||||
}
|
||||
|
||||
# Relaunch the script with elevated privileges if not running as Administrator
|
||||
if (-not (Test-Administrator)) {
|
||||
Write-Host "This script needs to be run as Administrator. Relaunching with elevated privileges..."
|
||||
Start-Process powershell.exe -ArgumentList "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
|
||||
Exit
|
||||
}
|
||||
|
||||
# Disable the NVIDIA GeForce GTX 1650 with Max-Q Design without confirmation
|
||||
Get-PnpDevice -FriendlyName "*NVIDIA GeForce GTX 1650 with Max-Q Design*" | Disable-PnpDevice -Confirm:$false
|
||||
|
||||
# Output success message
|
||||
Write-Host "The NVIDIA GeForce GTX 1650 with Max-Q Design has been disabled."
|
||||
|
||||
19
enableGPU.ps1
Normal file
19
enableGPU.ps1
Normal file
@@ -0,0 +1,19 @@
|
||||
# Function to check if the script is running as Administrator
|
||||
function Test-Administrator {
|
||||
$currentUser = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
|
||||
$currentUser.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)
|
||||
}
|
||||
|
||||
# Relaunch the script with elevated privileges if not running as Administrator
|
||||
if (-not (Test-Administrator)) {
|
||||
Write-Host "This script needs to be run as Administrator. Relaunching with elevated privileges..."
|
||||
Start-Process powershell.exe -ArgumentList "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
|
||||
Exit
|
||||
}
|
||||
|
||||
# Disable the NVIDIA GeForce GTX 1650 with Max-Q Design without confirmation
|
||||
Get-PnpDevice -FriendlyName "*NVIDIA GeForce GTX 1650 with Max-Q Design*" | Enable-PnpDevice -Confirm:$false
|
||||
|
||||
# Output success message
|
||||
Write-Host "The NVIDIA GeForce GTX 1650 with Max-Q Design has been disabled."
|
||||
|
||||
Reference in New Issue
Block a user