Windows PowerShell command on Get-command Enable-PnpDevice
MyWebUniversity

Windows PowerShell command on Get-command Enable-PnpDevice

NAME

Enable-PnpDevice

SYNOPSIS

Enables a PnP device.

SYNTAX

Enable-PnpDevice [-InstanceId] [-CimSession ] [-InformationAction {SilentlyContinue |

Stop | Continue | Inquire | Ignore | Suspend}] [-InformationVariable ] [-PassThru] [-ThrottleLimit

] []

Enable-PnpDevice [-CimSession ] [-InformationAction {SilentlyContinue | Stop | Continue | Inquire |

Ignore | Suspend}] [-InformationVariable ] [-PassThru] [-ThrottleLimit ] []

DESCRIPTION

The Enable-PnpDevice cmdlet enables a Plug and Play (PnP) device. You must use an Administrator account to enable

a device.

PARAMETERS

-CimSession []

Runs the cmdlet in a remote session or on a remote computer. Enter a computer name or a session object, such

as the output of a New-CimSession or Get-CimSession cmdlet. The default is the current session on the local

computer. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false

-InformationAction []

Specifies how this cmdlet responds to an information event. The acceptable values for this parameter are:ÿ

-- SilentlyContinue

-- Stop

-- Continue

-- Inquire

-- Ignore

-- Suspend

Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false

-InformationVariable []

Specifies a variable in which to store an information event message. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false

-InstanceId

Specifies an array of unique instance ID of devices. Required? true Position? 1 Default value none

Accept pipeline input? true(ByPropertyName)

Accept wildcard characters? false

-PassThru []

Indicates that this cmdlet returns a WMI error code. By default, this cmdlet does not return a value. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false

-ThrottleLimit []

Specifies the maximum number of concurrent operations that can be established to run the cmdlet. If this parameter is omitted or a value of 0 is entered, then Windows PowerShellr calculates an optimum throttle limit for the cmdlet based on the number of CIM cmdlets that are running on the computer. The throttle limit applies only to the current cmdlet, not to the session or to the computer. Required? false Position? named Default value none Accept pipeline input? false Accept wildcard characters? false This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).

INPUTS

Microsoft.Management.Infrastructure.CimInstance#ROOT/Cimv2/Win32_PnPEntity[] The Microsoft.Management.Infrastructure.CimInstance object is a wrapper class that displays Windows Management Instrumentation (WMI) objects. The path after the pound sign (#) provides the namespace and class name for the underlying WMI object.

OUTPUTS

Int32 This cmdlet generates a WMI error code.

NOTES

You must use an Administrator account for this cmdlet.

Example 1: Enable a device

PS C:\>Enable-PnpDevice -InstanceId 'USB\VID_5986&;PID_0266&;MI_00\7&;1E5D3568&;0&;0000'

This command enables the device that has the specified instance ID.

Example 2: Enable all disabled devices

PS C:\>Get-PnpDevice | Where-Object {$_.Problem -match 22} | Enable-PnpDevice

This command gets all the PnP devices by using the Get-PnpDevice cmdlet, and then passes them to the Where-Object

cmdlet by using the pipeline operator. For more information, type Get-Help Where-Object. That cmdlet drops the

devices that do not have a Problem value of 22. That problem code means that the device is disabled. The current cmdlet enables those disabled devices.

RELATED LINKS

Disable-PnpDevice

Get-PnpDevice



Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 OurUNIX.com ™