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

fetch-configlet.ps1: "Cannot validate argument" error #839

Closed
ee7 opened this issue Nov 26, 2023 · 3 comments · Fixed by #841
Closed

fetch-configlet.ps1: "Cannot validate argument" error #839

ee7 opened this issue Nov 26, 2023 · 3 comments · Fixed by #841
Assignees

Comments

@ee7
Copy link
Member

ee7 commented Nov 26, 2023

From a forum thread:

bin$ pwsh ./fetch-configlet.ps1
Invoke-WebRequest: /mnt/c/Users/bugma/Source/Repos/3rdParty/euphoria/bin/fetch-configlet.ps1:29
Line |
  29 |  Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
     |                         ~~~~~~~~~~~~
     | Cannot validate argument on parameter 'Uri'. The argument is null or
     | empty. Provide an argument that is not null or empty, and then try
     | the command again.

This looks different from the error in #786.

@ErikSchierboom
Copy link
Member

See #841

@ee7 ee7 closed this as completed in #841 Dec 15, 2023
ee7 pushed a commit that referenced this issue Dec 15, 2023
Under some conditions, running the fetch-configlet PowerShell script
could now produce an error like the below:

    $ pwsh ./fetch-configlet.ps1
    Invoke-WebRequest: /mnt/c/Users/bugma/Source/Repos/3rdParty/euphoria/bin/fetch-configlet.ps1:29
    Line |
      29 |  Invoke-WebRequest -Uri $downloadUrl -OutFile $outputFile @requestOpts
         |                         ~~~~~~~~~~~~
         | Cannot validate argument on parameter 'Uri'. The argument is null or
         | empty. Provide an argument that is not null or empty, and then try
         | the command again.

Fix that, and make the script more similar to the bash one.

Changes:

- Fix command chaining

- Move $arch closer to place of use

- Use name field to exactly match filename

- Test if script is run from repo root

- Add message for downloading

- Replace broken expand-archive with ZipFile

- Use explicit output filename

- Output download info

Closes: #839
@ee7
Copy link
Member Author

ee7 commented Jan 3, 2024

@ErikSchierboom do you want to sync the fetch-configlet scripts Exercism-wide?

@ErikSchierboom
Copy link
Member

Yes, I'll do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants