Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove -Resume parameter from Invoke-Webrequest commands in task setup #880

Closed
rmunn opened this issue Jun 13, 2024 · 3 comments · Fixed by #900
Closed

Remove -Resume parameter from Invoke-Webrequest commands in task setup #880

rmunn opened this issue Jun 13, 2024 · 3 comments · Fixed by #900
Assignees
Labels
🧑‍💻 DX Developer experience problem

Comments

@rmunn
Copy link
Contributor

rmunn commented Jun 13, 2024

In #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 from powershell to pwsh).

We need to either:

  • remove the -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
  • add a step to download and install a modern version of Powershell before running the Invoke-WebRequest command, so that we can then count on modern pwsh features and bugfixes to be present.
@rmunn rmunn added the 🧑‍💻 DX Developer experience problem label Jun 13, 2024
@rmunn
Copy link
Contributor Author

rmunn commented Jun 13, 2024

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.

@hahn-kev
Copy link
Collaborator

let's just remove the -Resume

@rmunn
Copy link
Contributor Author

rmunn commented Jun 26, 2024

The valid SHA256 checksums for sena-3.zip and elawa.zip, which you should hardcode into the Taskfile.yml, are:

  • sena-3.zip: bec5131799db07bf8d84d8fc1f3169fb2574f2a1f4c37f6898eab563a4ae95b8
  • elawa.zip: e3608f1e3188ce5fdb166fbf9d5aad06558db68efa079fb453881572b50cb8e3

@rmunn rmunn changed the title task setup on Windows requires PowerShell version not installed by default Remove -Resume parameter from Invoke-Webrequest commands in task setup Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧑‍💻 DX Developer experience problem
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants