Pixi shell Windows: error execution of scripts are deactivated on this system
Checks
-
[x] I have checked that this issue has not already been reported.
-
[x] I have confirmed this bug exists on the latest version of pixi, using
pixi --version.
Reproducible example
pixi shell
Issue description
I get this error :
Impossible de charger le fichier C:\Users\Rodri\AppData\Local\Temp\.tmp8hYszu.ps1, car l’exécution de scripts est
désactivée sur ce système. Pour plus d’informations, consultez about_Execution_Policies à l’adresse
https://go.microsoft.com/fwlink/?LinkID=135170.
+ CategoryInfo : Erreur de sécurité : (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnauthorizedAccess
Expected behavior
standart behavior of pixi shell
I find nothing about windows in the shell documentation : https://pixi.sh/latest/advanced/pixi_shell/#issues-with-pixi-shell
Perhaps this is caused by the powershell execution policy. Could you try running:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Bypass -Force;
and rerun pixi shell.
There is a related PR in conda: https://github.com/conda/conda/pull/14755
However, it just checks the execution policy and then skips the hook. I am not sure if there is more we could do?
It would be nice if we could override the location of these to bypass the use of AppData\Local D:\Users[YOURUSERNAME]\AppData\Local\Temp.tmpGm.ps1 - IT seem to be amenable to making a fixed location and decendents unrestricted - but not temporary spaces. This goes for poweshell scripts and exe files (which end up in pixi environments).
You mean that you would be able to define the "temp" directory pixi uses to activate these scripts?
Yes, being able to set that to a dedicated temp folder for pixi would allow us to treat it differently to the default space.