[smartmontools-support] Issue with drivedb.h PowerShell update script on windows

Andrew D. andrewd_it at yahoo.com
Mon Jan 19 12:48:27 CET 2026


Hello.

I met some issues with update script and finally get them fixed.
Source of issue is that at least on Windows 7 / Powershell 5.1 it tries to use old sequrity protocols by default that is disabled.

Solution is simple - put one of this lines before processing to download:
[Net.ServicePointManager]::SecurityProtocol = "Tls12, Tls11, Tls, Ssl3"
or just
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

my final modified download function looks like this (iecho $req I put there just for debugging):

---------

function download($url, $file, [ref]$errmsg)
{
  $req = @{ Uri = $url; OutFile = $file; MaximumRedirection = 0 }
  if ($script:Insecure) {
    # #Requires -Version 6
    $req += @{ SkipCertificateCheck = $true }
  }

  $errmsg.Value = ""
  [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
  # iecho $req
  if ($script:DryRun) {
    echo "Invoke-WebRequest $(echo @req)"
  } else {
    try {
      Invoke-WebRequest @req
    } catch {
      if ($_.Exception.Message) {
        $errmsg.Value = $_.Exception.Message
      } else {
        $errmsg.Value = "Unknown error"
      }
    }
  }
}

---------

Please update script in future releases to make it work out of the box.
Thank you in advance.



More information about the Smartmontools-support mailing list