Windows Enterprise Desktop

Aug 23 2017   9:55AM GMT

Win10 PowerShell Chkdsk Alternative

Ed Tittel Ed Tittel Profile: Ed Tittel

Tags:
CHKDSK
PowerShell cmdlets
Windows 10

In the latest Win10 versions, PowerShell replaces the command prompt (cmd.exe) in the Winkey-X pop-up menu. And it runs most command-line programs unaltered, including chkdsk. But PowerShell also offers alternative cmdlets (pronounced “command-lets”) as well. In fact, the Win10 PowerShell Chkdsk alternative is the Repair-Volume cmdlet. Here’s what the get-help subsystem in PowerShell has to say about this cmdlet:

Win10 PowerShell Chkdsk Alternative

Repair-Volume offers most of the same functionality as chkdsk in a form that’s native to PowerShell.
[Click image to see full-sized view]

Exploring the Win10 PowerShell Chkdsk Alternative: Repair-Volume

The most frequently used version of Repair-Volume takes a volume offline for scanning, and attempts fixes on any errors it finds. Thus, the basic syntax for this version of the command is:

Repair-volume -Driveletter <DrvLtr> -OfflineScanAndFix

Where you’d substitute the letter for the drive you wish to scan for the generic <DrvLtr> parameter. I tried this out on my production system yesterday because it currently supports 10 drives. I’m pleased to report it worked on all drives, including the boot/system drive, C:. It was interesting to see the drive information (the bar that shows how much space the drive provides, and how much is used) disappear while this process was underway, as shown here for one of my biggest drives (J: 3TB nominal):

drivej

When it’s running for some specific drive, that drive’s disk info disappears (it’s off-line).
[Click image to see full-sized view]

Using Repair-Volume Day-to-Day

Actually, this cmdlet is incredibly easy to use. You’ll find it handy when you need to check drives under most circumstances. Also, because it even works on your boot/system drive you’ll find yourself needing to schedule chkdsk after restart less often. Finally, those who want to create a PowerShell command file (.ps1 extension) can easily put something together to do this for all of their drives, and run it periodically as a scheduled task.

Thanks to Sergey Tkachenko at WinAero.com, whose blog post “How to Check a Drive for Errors in Windows 10” (posted 8/22) brought this cmdlet to my attention.

1  Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.
  • Kevin Beaver
    Thanks for this, Ed!
    24,490 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: