mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-25 13:36:39 +01:00
Improved check-file-system.ps1
This commit is contained in:
parent
d10466f01c
commit
52e3ea66a3
@ -15,9 +15,10 @@ if ($Drive -eq "" ) {
|
||||
}
|
||||
|
||||
try {
|
||||
repair-volume -driveLetter $Drive -scan
|
||||
$Result = repair-volume -driveLetter $Drive -scan
|
||||
if ($Result -ne "NoErrorsFound") { throw "'repair-volume' failed" }
|
||||
|
||||
write-host -foregroundColor green "OK - drive $Drive is non-corrupt"
|
||||
write-host -foregroundColor green "OK - file system on drive $Drive is clean"
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
Loading…
Reference in New Issue
Block a user