-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
Cannot change 'Path' in registry #48
Comments
Can you provide a short explanation for setting up a test environment on Azure? |
In fact, it is caused by
|
I don't have an azure vm to test, and may need other people to help solve it. Since the changes of #44 are mostly inherited from ScoopInstaller/Scoop#5395, and I didn't find a hidden problem in it, so maybe your problem is caused by this. When there is no scoop in the environment variable, and using irm get.scoop.sh | iex similar commands to install scoop, my code will add the scoop dir to the Path, in fact it also adds. But I don’t know why, if you use the right-click Windows start key (Windows 11) to invoke Powershell or use the search (Windows 11) to get cmd or Powershell, you can’t get new environment variables after installation. But if you pin Windows Terminal inthe taskbar, the cmd/Powershell you get after clicking it can get new environment variables. I think the session of the environment variable caused by the new code may be abnormal, but I don't have time to explore until the weekend (I don’t have time on weekdays). It is worth mentioning that ScoopInstaller/Scoop will also be affected (can verify by installing Python, because installing Python will add new environment variables), so we need to fix this problem before upgrading to 0.3.2. I am sorry for the trouble caused to you by my modification of the code, currently you can install scoop by using the historical version of install.ps1. |
Changing the registry value is not enough. |
😅 Problem can date back to 2009 PowerShell/PowerShell#16989 (comment) Need to broadcast the change after updating env vars. |
@r15ch13 the native refs: Edit: |
Hi @WHYBBE & @rashil2000 ,
After #44 , we cannot install scoop successfully via Azure Run command (https://learn.microsoft.com/en-us/azure/virtual-machines/windows/run-command).
The root cause is Write-Env does not effect via Azure Run command.
I try to output '$EnvRegisterKey.GetValue($name)' after SetValue, the value is changed. But when I open Registry Editor, I found it remains the original value.
I try to run Write-Env directly inside VM, it works.
The text was updated successfully, but these errors were encountered: