Created
April 16, 2020 08:38
-
-
Save yushulx/27ecfc190ed091dc6373e43c6558e582 to your computer and use it in GitHub Desktop.
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
Get-PnpDevice -FriendlyName *webcam* | |
Get-PnpDevice -FriendlyName *webcam* -Class Camera,image | |
Disable-PnpDevice -InstanceId (Get-PnpDevice -FriendlyName *webcam* -Class Image -Status OK).InstanceId | |
Disable-PnpDevice -InstanceId (Get-PnpDevice -FriendlyName *webcam* -Class Camera -Status OK).InstanceId | |
Enable-PnpDevice -InstanceId (Get-PnpDevice -FriendlyName *webcam* -Class Image -Status Error).InstanceId | |
Enable-PnpDevice -InstanceId (Get-PnpDevice -FriendlyName *webcam* -Class Camera -Status Error).InstanceId |
I'm trying a similar command but always throws an error even in Administrator mode.
Commad:
Disable-PnpDevice -InstanceId (Get-PnpDevice -FriendlyName *Silicon* -Status Unknown).InstanceId
Error:
Disable-PnpDevice : Generic failure
At line:1 char:71
+ ... endlyName *Silicon* | select -Property instanceid | Disable-PnpDevice
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (Win32_PnPEntity...PID_EA60\0001"):ROOT\cimv2\Win32_PnPEntity) [Disable-PnpDevice], CimException
+ FullyQualifiedErrorId : HRESULT 0x80041001,Disable-PnpDevice
@radershan probably change the commands to
Disable-PnpDevice -InstanceId (Get-PnpDevice -FriendlyName *camera* -Class Camera -Status OK).InstanceId
Enable-PnpDevice -InstanceId (Get-PnpDevice -FriendlyName *camera* -Class Camera -Status Error).InstanceId
You can firstly check the device name by running Get-PnpDevice
.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you