Scan and Repair with the –OfflineScanAndFix Powershell cmdlet

The Repair-Volume cmdlet performs repairs on a volume. The following repair actions are available:

OfflineScanAndFix: Takes the volume offline to scan the volume and fix any errors found (equivalent to chkdsk /f).

If you feel that you are running into problems, so it should be fixed. First you need to understand that to make the disk offline it will mark the disk for next reboot, and the scan will take place on the next reboot. So, fix the disk using the –OfflineScanAndFix parameter. Please be mindful that your boot drive, eventually C; if this command is run it will fail, but the drive will be marked and will be scanned at the next reboot.

PS C:\> repair-volume -DriveLetter D -OfflineScanAndFix -CimSession

More information can be found here: