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

Support Custom Command Format for pwsh in the shell Field #4595

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Yionse
Copy link
Member

@Yionse Yionse commented Dec 3, 2024

Fix issue #4592. This PR supports users to customize the command format of pwsh in theshel field, for example: pwsh [more_options]. Azd will directly launch the command window with this customized value.

For example, to avoid loading the profile.ps1 file, users can set the shell: pwsh -NoProfile to start in no-profile mode, as shown:
image

@rajeshkamal5050 for notification.

@Yionse Yionse changed the title Fix azd issue #4592 Support skipping profile.ps1 loading in PowerShell Hooks by passing -NoProfile Dec 3, 2024
@v-xuto
Copy link
Member

v-xuto commented Dec 9, 2024

@rajeshkamal5050 Who should we reach out to for reviewing this PR?

@rajeshkamal5050
Copy link
Contributor

@hemarina @vhvb1989 can you help review?

Copy link
Contributor

@hemarina hemarina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

cli/azd/cmd/hooks.go Outdated Show resolved Hide resolved
Copy link
Member

@vhvb1989 vhvb1989 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

cli/azd/pkg/ext/hooks_runner.go Outdated Show resolved Hide resolved
@weikanglim
Copy link
Contributor

@Yionse @v-xuto I'm wondering when we're doing:

pwsh -NoProfile myScript.ps1

This would actually:

  1. Launch a process pwsh
  2. The pwsh process launches a child process pwsh -NoProfile myScript.ps1

which is less ideal.

Something more comprehensive is probably allowing the configuration of the shell command: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#custom-shell

@Yionse Yionse changed the title Support skipping profile.ps1 loading in PowerShell Hooks by passing -NoProfile Support Custom Command Format for pwsh in the shell Field Jan 9, 2025
@Yionse
Copy link
Member Author

Yionse commented Jan 9, 2025

@weikanglim, According to your suggestion, I have resubmitted. Now can configure the shell. Please re-review.

@vhvb1989
Copy link
Member

@Yionse , unit tests are failing. Please take a look

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 this pull request may close these issues.

8 participants