You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When PowerShell hook scripts are executed, if the user has a profile.ps1 then the profile script is executed. It would be better to call pwsh.exe with the -noprofile switch to ensure profile scripts are not loaded.
@rajeshkamal5050, We can reproduce the issue and are currently attempting to fix it.
The currently planned solution is to check if the user explicitly passed the -NoProfile parameter before executing the PowerShell hook command. If the user passed the -NoProfile parameter, then manually pass the -NoProfile parameter when calling pwsh.exe to execute the hook command. If the user did not pass the -NoProfile parameter, pwsh.exe will not include it when executing and will load the profile.ps1 configuration file.
Output from
azd version
azd version 1.11.0 (commit 5b92e06)
Describe the bug
When PowerShell hook scripts are executed, if the user has a profile.ps1 then the profile script is executed. It would be better to call pwsh.exe with the
-noprofile
switch to ensure profile scripts are not loaded.To Reproduce
Execute azd with a PowerShell hook script configured on a machine where a profile.ps1 exists in one of the standard directories: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles?view=powershell-7.4
Expected behavior
The profile script should not be executed.
Environment
Information on your environment:
* PowerShell 7.4.6, Windows 11
* IDE and version : Visual Studio Code
Additional context
The -noprofile switch for pwsh.exe is documented here: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_pwsh?view=powershell-7.4#-noprofile---nop
The text was updated successfully, but these errors were encountered: