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
Create machine wide environment variables 'A' and 'B' using Install-ChocolateyEnvironmentVariable with values 'A' = "some_value" and 'B' = "%A%" the variable B is not expanded.
To create B variable: "Install-ChocolateyEnvironmentVariable -VariableName 'B' -VariableValue '%A%' -VariableType Machine"
In registry ('Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment' both values are created as type 'REG_SZ', but correctly type of 'B' should be 'REG_EXPAND_SZ' to ensure system loads variables in correct order.
As a workaround SETX could be called which creates proper type.
The text was updated successfully, but these errors were encountered:
jmusek
changed the title
Install-ChocolateyEnvironmentVariable does't create expandable variables
Install-ChocolateyEnvironmentVariable does't create expandable variables properly
Nov 20, 2017
I thought we exposed the type as a parameter to the function. I could be thinking of maybe another issue where we had fixed this with the path updates but maybe had not ported it over to this function
Create machine wide environment variables 'A' and 'B' using Install-ChocolateyEnvironmentVariable with values 'A' = "some_value" and 'B' = "%A%" the variable B is not expanded.
To create B variable: "Install-ChocolateyEnvironmentVariable -VariableName 'B' -VariableValue '%A%' -VariableType Machine"
In registry ('Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment' both values are created as type 'REG_SZ', but correctly type of 'B' should be 'REG_EXPAND_SZ' to ensure system loads variables in correct order.
As a workaround SETX could be called which creates proper type.
The text was updated successfully, but these errors were encountered: