Get-WssDriveInUse

Checks whether a drive is in use.

Syntax

Get-WssDriveInUse
   [-Drive] <Drive>
   [<CommonParameters>]

Description

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

Examples

Example 1: Check whether a drive is in use

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

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.

Parameters

-Drive

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

Type:Drive
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Outputs

Microsoft.WindowsServerSolutions.Storage.DriveInUseRequest

This cmdlet generates a drive in use indicator.