Test-WssDrive
Test-WssDrive
Checks a drive for file system errors, and optionally repairs errors.
Sintaxis
Parameter Set: OpParamSet
Test-WssDrive [-Drive] <Drive> [-Repair] [ <CommonParameters>]
Parameter Set: CancelParamSet
Test-WssDrive [-Drive] <Drive> [-Cancel] [ <CommonParameters>]
Descripción detallada
The Test-WssDrive cmdlet checks a drive for file system errors. You can use this cmdlet to attempt to repair file system errors. You can also use this cmdlet to stop a current check for errors. To obtain a Drive object to check, use the Get-WssDrive cmdlet.
Parámetros
-Cancel
Indicates that the cmdlet cancels an in-progress Test-WssDrive check.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
-Drive<Drive>
Specifies a Drive object. To obtain a Drive object, use the Get-WssDrive cmdlet.
Alias |
ninguno |
¿Requerido? |
true |
¿Posición? |
1 |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
True (ByValue) |
¿Aceptar caracteres comodín? |
false |
-Repair
Indicates that the cmdlet attempts to repair file system errors that it finds.
Alias |
ninguno |
¿Requerido? |
false |
¿Posición? |
named |
Valor predeterminado |
ninguno |
¿Aceptar canalización? |
false |
¿Aceptar caracteres comodín? |
false |
<CommonParameters>
Este cmdlet admite los siguientes parámetros comunes: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer y -OutVariable. Para obtener más información, consulte about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Entradas
El tipo de entrada es el tipo de los objetos que se pueden canalizar al cmdlet.
- Microsoft.WindowsServerSolutions.Storage.Drive
Salidas
El tipo de resultado es el tipo de objetos que emite el cmdlet.
Microsoft.WindowsServerSolutions.Storage.CheckDiskRequest
This cmdlet generates a request to check or repair a disk.
Ejemplos
Example 1: Check and repair a drive
This example runs a check on a drive, and attempts to repair any file system errors. 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 runs a check on the Drive object stored in the $Drive variable. The command includes the Repair parameter, therefore the command attempts to repair any file system errors it finds.
PS C:\> $Drive = Get-WssDrive -ID b6b093a2-1860-4172-a4a5-07ce2aebfa13
PS C:\> Test-WssDrive -Drive $Drive -Repair