working on my laptop with 1650 maxq

This commit is contained in:
2024-11-01 11:12:49 +01:00
commit 796842ff1e
2 changed files with 38 additions and 0 deletions

19
disableGPU.ps1 Normal file
View 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
View 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."