Skip to content

Windows: PowerShell PATH issue prevents thv command recognition #2

@JAORMX

Description

@JAORMX

Problem Description

The Toolhive CLI (thv) is successfully installed on Windows runners but is not recognized in PowerShell environments, even though it works correctly in Git Bash.

Current Behavior

  1. Installation completes successfully
  2. Binary is placed in /c/Users/runneradmin/.toolhive/bin/thv.exe
  3. PATH is updated via $GITHUB_PATH and $GITHUB_ENV
  4. Git Bash can execute thv commands
  5. PowerShell fails with: "The term 'thv' is not recognized as a name of a cmdlet, function, script file, or executable program"

Expected Behavior

The thv command should be available in all shells after installation, including PowerShell.

Workarounds

Users can currently work around this issue by:

  1. Using shell: bash in their workflow steps
  2. Referencing the full path to the binary: ${{ steps.install.outputs.path }}

Technical Details

  • The issue appears to be related to how GitHub Actions handles PATH updates between different shells
  • The PATH environment variable is set correctly but PowerShell doesn't pick it up in the same workflow step

Test Logs

PATH: /c/Users/runneradmin/.toolhive/bin:/mingw64/bin:/usr/bin:...
thv: The term 'thv' is not recognized as a name of a cmdlet, function, script file, or executable program.

Potential Solutions

  1. Investigate using [Environment]::SetEnvironmentVariable() for PowerShell
  2. Add explicit PowerShell PATH manipulation
  3. Provide Windows-specific installation steps
  4. Document the limitation and recommend bash shell usage

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is neededwindows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions