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

[Issue] warn users when they need to install powershell 7 (or fallback to powershell 5) #4560

Open
1 task done
qubitron opened this issue Nov 15, 2024 · 0 comments
Open
1 task done

Comments

@qubitron
Copy link

Output from azd version
Run azd version and copy and paste the output here:

azd version 1.11.0 (commit 5b92e0687e1fa96dfc8292f4b900c0c58610b6a5)

Describe the bug

'pwsh' is not recognized as an internal or external command,
operable program or batch file.
WARNING: 'postprovision' hook failed with exit code: '1', Path: '.\scripts\write_env.ps1'. : exit code: 1
Execution will continue since ContinueOnError has been set to true.

To Reproduce
On a machine with powershell 5 command, run a sample that uses powershell post provision hooks, such as: https://github.com/azureai-samples/azureai-basic-python

Expected behavior
It took me a while to realize that pwsh is for powershell 7 and that powershell is for powershell 5, could azd check for the presence of pwsh and if it doesn't exist:

  • fallback to using ````powershell``` to run the command
  • guide users to install powershell 7

Environment
Windows, VS Code (latest), Python

* Language name and version
* IDE and version : [e.g. Visual Studio 16.3]

Additional context
Add any other context about the problem here.

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

No branches or pull requests

2 participants