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

Invoke-analyzer module not available when running in pre-commit docker #14

Closed
krisgeus opened this issue Jan 3, 2024 · 1 comment · Fixed by #15
Closed

Invoke-analyzer module not available when running in pre-commit docker #14

krisgeus opened this issue Jan 3, 2024 · 1 comment · Fixed by #15

Comments

@krisgeus
Copy link
Owner

krisgeus commented Jan 3, 2024

Invoke-ScriptAnalyzer: /bin/analyze-pwsh-snippet.ps1:12
Line |
  12 |  Invoke-ScriptAnalyzer -ScriptDefinition $pwsh_snippet -EnableExit -Re …
     |  ~~~~~~~~~~~~~~~~~~~~~
     | The term 'Invoke-ScriptAnalyzer' 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.

Command running: docker run -v ${PWD}:/src:rw,Z --user $(id -u):$(id -g) --workdir /src [ghcr.io/krisgeus/inline-pwsh-check:latest](http://ghcr.io/krisgeus/inline-pwsh-check:latest) deploy.yml

When running without the --user it works correctly.
I assume it is because the installed module is not available for all users somehow.

@krisgeus
Copy link
Owner Author

krisgeus commented Jan 3, 2024

Install the module with "-Scope AllUsers"

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.

1 participant