Closed rmunn closed 4 months ago
Looks like -Resume
is buggy anyway: although PowerShell/PowerShell#13982 is marked as completed, it's still happening. If you pass -Resume
when the file already exists, PowerShell throws a NullReferenceError. I suspect that this line is to blame, but I'm not going to spend time troubleshooting PowerShell; that's a total waste of my time. We'll just check that the zip file matches a checksum (which we will check into Git so that we can change it later if we upload a different version of the sena-3.zip file, for example), and skip the download if the checksum matches. If it doesn't match, we'll download without -Resume
, which is documented to overwrite any existing files.
let's just remove the -Resume
The valid SHA256 checksums for sena-3.zip
and elawa.zip
, which you should hardcode into the Taskfile.yml, are:
In https://github.com/sillsdev/languageforge-lexbox/pull/850 I used the Powershell command
Invoke-WebRequest -Resume
, which was introduced in Powershell 6.1. I did not realize that even on Windows 11, the Powershell version that ships with the OS is Powershell 5.1, and to get the latest version of Powershell 6 or higher (currently 7.4) you need to download an .msi file from GitHub. (Also, the command name changed frompowershell
topwsh
).We need to either:
-Resume
part of the Invoke-WebRequest command (and skip running it if the .zip file matches a checksum, making the setup-win script more complicated but able to run on powershell 5.1), or