mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-12 06:02:56 +02:00
Improve the done output
This commit is contained in:
@ -16,15 +16,13 @@
|
||||
|
||||
param([string]$Drive = "")
|
||||
|
||||
if ($Drive -eq "" ) {
|
||||
$Drive = read-host "Enter drive (letter) to check"
|
||||
}
|
||||
|
||||
try {
|
||||
if ($Drive -eq "" ) { $Drive = read-host "Enter drive (letter) to check" }
|
||||
|
||||
$Result = repair-volume -driveLetter $Drive -scan
|
||||
if ($Result -ne "NoErrorsFound") { throw "'repair-volume' failed" }
|
||||
|
||||
write-host -foregroundColor green "✔️ file system on drive $Drive is clean"
|
||||
"✔️ file system on drive $Drive is clean"
|
||||
exit 0
|
||||
} catch {
|
||||
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||
|
Reference in New Issue
Block a user