an error in query-smart-data.ps1
OlegBoul opened this issue · comments
OlegBoul commented
you need to change $DevInfo++ onto $DevNo
in $DevInfo++
at line 54, wrong:
[int]$DevNo = 1
foreach($Device in $Devices) {
write-output "(3) Querying data from S.M.A.R.T. device $Device..."
$Time = (Get-Date)
$Filename = "$Directory/SMART-dev$($DevNo)-$($Time.Year)-$($Time.Month)-$($Time.Day).json"
write-output "(4) Saving data to $Filename..."
$Cmd = "smartctl --all --json " + $Device
Invoke-Expression $Cmd > $Filename
$DevInfo++
}
right:
[int]$DevNo = 1
foreach($Device in $Devices) {
write-output "(3) Querying data from S.M.A.R.T. device $Device..."
$Time = (Get-Date)
$Filename = "$Directory/SMART-dev$($DevNo)-$($Time.Year)-$($Time.Month)-$($Time.Day).json"
write-output "(4) Saving data to $Filename..."
$Cmd = "smartctl --all --json " + $Device
Invoke-Expression $Cmd > $Filename
$DevNo++
}
Markus Fleschutz commented
Should be fixed now. Thank you very much for the hint.
OlegBoul commented
Welcome!
Отправлено с iPhone
… 12 окт. 2022 г., в 14:26, Markus Fleschutz ***@***.***> написал(а):
Should be fixed now. Thank you very much for the hint.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.
Markus Fleschutz commented
Issue is closed now.