/disaleTouchPad.ps1 Secret
Last active
July 23, 2023 04:56
Star
You must be signed in to star a gist
Disable Touch Pad with PowerShell Script
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
$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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Make sure to run
Set-ExecutionPolicy Unrestricted
in PowerShell before running the script.