Created
February 17, 2020 05:44
-
-
Save am2222/541a7ca599247ddf1ff98661e49b8a0c to your computer and use it in GitHub Desktop.
disable_touch_screen
This file contains hidden or 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
$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