Skip to content

Instantly share code, notes, and snippets.

@am2222
Created February 17, 2020 05:44
Show Gist options
  • Save am2222/541a7ca599247ddf1ff98661e49b8a0c to your computer and use it in GitHub Desktop.
Save am2222/541a7ca599247ddf1ff98661e49b8a0c to your computer and use it in GitHub Desktop.
disable_touch_screen
$list=Get-PnpDevice | Sort-Object -Property Name | Where-Object{
( $_.ConfigurationFlags -NotLike '*DISABLED*') -and
( $_.FriendlyName -like '*touch screen*' ) }| ft Name, InstanceId -AutoSize
if($list.count==1){
Get-PnpDevice | Where-Object {$_.FriendlyName -like '*touch screen*'} | Disable-PnpDevice -Confirm:$false
}else{
Get-PnpDevice | Where-Object {$_.FriendlyName -like '*touch screen*'} | Enable-PnpDevice -Confirm:$false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment