got rid of filesystemlabel in favor of driveletter
This commit is contained in:
parent
043a592457
commit
776bea8402
@ -24,18 +24,18 @@ Function Write-Log{
|
||||
|
||||
Write-Output "Checking disks for $($computerName)"
|
||||
|
||||
foreach ($i in $volumes) {
|
||||
if ($i.FileSystemLabel -eq "") {
|
||||
foreach ($i in $volumes.DriveLetter) {
|
||||
if ($i.DriveLetter -eq "") {
|
||||
Write-Output ""
|
||||
} else {
|
||||
$result=Repair-Volume -FileSystemLabel $i.FileSystemLabel -Scan
|
||||
$result=Repair-Volume -FileSystemLabel $i.DriveLetter -Scan
|
||||
|
||||
if ($result.value -gt 0) {
|
||||
Repair-Volume -FileSystemLabel $i.FileSystemLabel -Scan -OfflineScanAndFix
|
||||
Repair-Volume -FileSystemLabel $i.DriveLetter -Scan -OfflineScanAndFix
|
||||
$requireReboot = $true
|
||||
} else {
|
||||
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)"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user