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)"
|
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)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user