got rid of filesystemlabel in favor of driveletter

This commit is contained in:
Wyatt J. Miller 2021-06-18 20:54:28 -04:00
parent 043a592457
commit 776bea8402

View File

@ -24,18 +24,18 @@ Function Write-Log{
Write-Output "Checking disks for $($computerName)" Write-Output "Checking disks for $($computerName)"
foreach ($i in $volumes) { foreach ($i in $volumes.DriveLetter) {
if ($i.FileSystemLabel -eq "") { if ($i.DriveLetter -eq "") {
Write-Output "" Write-Output ""
} else { } else {
$result=Repair-Volume -FileSystemLabel $i.FileSystemLabel -Scan $result=Repair-Volume -FileSystemLabel $i.DriveLetter -Scan
if ($result.value -gt 0) { if ($result.value -gt 0) {
Repair-Volume -FileSystemLabel $i.FileSystemLabel -Scan -OfflineScanAndFix Repair-Volume -FileSystemLabel $i.DriveLetter -Scan -OfflineScanAndFix
$requireReboot = $true $requireReboot = $true
} else { } else {
Write-Output "$($i.FileSystemLabel): Drive is OK!" Write-Output "$($i.FileSystemLabel): Drive is OK!"
Write-Log "$($now), $($i.FileSystemLabel), $($result), $($computerName)" Write-Log "Date: $($now), Drive Letter: $($i.DriveLetter), Volume Name: $($i.FileSystemLabel), Result: $($result), $($computerName)"
} }
} }
} }