Get-WssDriveInUse

Get-WssDriveInUse

Checks whether a drive is in use.

Syntax

Parameter Set: Default
Get-WssDriveInUse [-Drive] <Drive> [ <CommonParameters>]

Detailed Description

The Get-WssDriveInUse cmdlet checks whether a drive is in use. To obtain a Drive object to check, use the Get-WssDrive cmdlet.

Parameters

-Drive<Drive>

Specifies a Drive object. To obtain a Drive object, use the Get-WssDrive cmdlet.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • DriveInUseRequest

Examples

Example 1: Check whether a drive is in use

This example checks whether a specified drive is in use. The first command uses the Get-WssDrive cmdlet to get a Drive object that has the specified GUID, and stores it in the $Drive variable.

The second command checks whether the Drive object stored in the $Drive variable is in use.

PS C:\> $Drive = Get-WssDrive -ID b6b093a2-1860-4172-a4a5-07ce2aebfa13
PS C:\> Get-WssDriveInUse -Drive $Drive

Get-WssDrive