Skip to content

🐞 Windows Installation Instructions parameters don't work  #7560

Closed

Description

@levlaz

What is the issue?

I thought this was resoled in #6901 but it seems like there are still issues with the Windows Installation instructions for the Dagger CLI. https://docs.dagger.io/install

I am able to to install just fine with this basic command:

Invoke-WebRequest -UseBasicParsing -Uri https://dl.dagger.io/dagger/install.ps1 | Invoke-Expression

However, if I try to change the path or version I get an error.

Command

$script = Invoke-WebRequest -UseBasicParsing -Uri https://dl.dagger.io/dagger/install.ps1
$params = "-InstallPath C:\temp"
"$script $params" | Invoke-Expression

Error

-InstallPath:
Line |
  94 |   -InstallPath C:\temp
     |   ~~~~~~~~~~~~
     | The term '-InstallPath' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Same issue for version.

Command

$script = Invoke-WebRequest -UseBasicParsing -Uri https://dl.dagger.io/dagger/install.ps1
$params = "-DaggerVersion 0.11.4"
"$script $params" | Invoke-Expression

Error

-DaggerVersion:
Line |
  94 |   -DaggerVersion 0.11.4
     |   ~~~~~~~~~~~~~~
     | The term '-DaggerVersion' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Activity

  1. added
    kind/bug
    on Jun 6, 2024
  2. jedevc commented on Jun 6, 2024

    @jedevc
    Contributor

    @levlaz out of curiosity what version of powershell is this?

    I've had this issue when using a version that's too low. See the first line of the installation instructions:

    If you want to use the installation script, PowerShell 7.0 or newer is required. From PowerShell

    Perhaps the install instructions need some clarification if this is the case? Like a sanity check for the version.

  3. pjmagee commented on Jun 6, 2024

    @pjmagee
    Contributor

    @levlaz out of curiosity what version of powershell is this?

    I've had this issue when using a version that's too low. See the first line of the installation instructions:

    If you want to use the installation script, PowerShell 7.0 or newer is required. From PowerShell

    Perhaps the install instructions need some clarification if this is the case? Like a sanity check for the version.

    The script could be written to actually run on Windows/Linux/Mac since powershell7 is xplat - not sure if that would also help with testing

  4. jedevc commented on Jun 6, 2024

    @jedevc
    Contributor

    Hm. I'm okay with allowing install.ps1 to work on non-windows, but it shouldn't be the default. Most Linux users don't (and IMO, shouldn't need to) have powershell installed.

  5. pjmagee commented on Jun 6, 2024

    @pjmagee
    Contributor

    Hm. I'm okay with allowing install.ps1 to work on non-windows, but it shouldn't be the default. Most Linux users don't (and IMO, shouldn't need to) have powershell installed.

    Yeah. I agree. I would imagine the defacto would be, A heavy windows user or team, may want portability to non-windows machines and in this case, they will utilise Powershell to be more xplat friendly.

    I think its perfectly acceptable to not have the dagger one run on linux.

  6. wingyplus commented on Jun 6, 2024

    @wingyplus
    Contributor

    Do we need to check powershell version somehow to make sure it works as expected?

  7. levlaz commented on Jun 6, 2024

    @levlaz
    ContributorAuthor
  8. pjmagee commented on Jun 9, 2024

    @pjmagee
    Contributor

    @levlaz out of curiosity what version of powershell is this?
    I was using the latest version of Powershell 7 for Windows. Initially I was running an older version but you can't even install the Dagger CLI on a pre 7.0 version.
    Perhaps the install instructions need some clarification if this is the case? Like a sanity check for the version.
    I think adding a version check as the first thing that the ps1 script does though would be a welcome improvement.

    it does have a version check right at the top #version 7

    image

  9. pjmagee commented on Jun 9, 2024

    @pjmagee
    Contributor

    I have a fix for this on a PR that was to improve the Powershell install experience a bit more as it looked like the script lost functionality from previous merges somewhere down the line. #7569

  10. levlaz commented on Jun 12, 2024

    @levlaz
    ContributorAuthor
  11. added a commit that references this issue on Jun 13, 2024
  12. jedevc commented on Jun 13, 2024

    @jedevc
    Contributor

    Oop, this got closed by #7569 - @levlaz does that fix your issue, or do we still need to keep this issue open?

  13. pjmagee commented on Jun 13, 2024

    @pjmagee
    Contributor

    we need to update the installation page docs because now the invoking works with Invoke-Expression | Install-Dagger -Interactive as an example. current documentation for install does not actually work with customising the install .

    Could lev retest maybe? I am happy to improve it further if we find its still not good for Win10 / and powershell isn't somehow recognising the #Version requirement, I have some ideas around that using the $PSVersion table which is another option.

  14. jedevc commented on Jun 14, 2024

    @jedevc
    Contributor

    @pjmagee are you able to PR the updated docs in? I can merge that update as part of our release process so the docs and script are deployed at the same time.

  15. pjmagee commented on Jun 14, 2024

    @pjmagee
    Contributor

    @pjmagee are you able to PR the updated docs in? I can merge that update as part of our release process so the docs and script are deployed at the same time.

    #7669

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions