Skip to content

Instantly share code, notes, and snippets.

@qihuahu
Last active July 23, 2023 04:56
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Disable Touch Pad with PowerShell Script
$DeviceName = "HID-compliant touch pad"
if(!([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) {
Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList "-File `"$($MyInvocation.MyCommand.Path)`" `"$($MyInvocation.MyCommand.UnboundArguments)`""
Exit
}
Get-PnpDevice -FriendlyName $DeviceName | Enable-PnpDevice -Confirm:$false
Get-PnpDevice -FriendlyName $DeviceName | Disable-PnpDevice -Confirm:$false
@qihuahu
Copy link
Author

qihuahu commented Jul 23, 2023

Make sure to run Set-ExecutionPolicy Unrestricted in PowerShell before running the script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment