mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-26 14:26:10 +01:00
Improved check-file-system.ps1
This commit is contained in:
parent
d10466f01c
commit
52e3ea66a3
@ -15,9 +15,10 @@ if ($Drive -eq "" ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
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
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
Reference in New Issue
Block a user