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 skipping profile.ps1 loading in PowerShell Hooks by passing -NoProfile #4595

Open
wants to merge 7 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 determines whether to load profile.ps1 by checking whether the first sentence of the PowerShell hook command is pwsh -NoProfile.

If the profile.ps1 file exists in the current environment, but the user does not want to load the file when executing PowerShell hook scripts, the user can configure hooks like this:

  • If it is a script file, add pwsh -NoProfile before command.
    Image

  • If it is a command, add pwsh -NoProfile -Command before command.
    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
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.

7 participants