reddsaver icon indicating copy to clipboard operation
reddsaver copied to clipboard

Windows username env fix doesn't work in Windows PowerShell (in contrast to the Command Prompt)

Open timleg002 opened this issue 3 years ago • 2 comments
trafficstars

Any of the provided fixes, set USERNAME, even setting a global variable using GUI or using setx doesn't work. Also I don't get why file-defined environment variables don't have a higher precedence than those already present in environment variables.

timleg002 avatar Mar 01 '22 19:03 timleg002

After some hunting around, the following fix works [System.Environment]::SetEnvironmentVariable('UserName', '', 'Process')

Tamnac avatar Oct 20 '22 05:10 Tamnac

It’s an easy one line fix by replacing the dotenv crate with dotenvs that supports overriding env vars. See https://github.com/mcdallas/gert/commit/12359023fc3b4366b88577e5c9e129909500981b

mcdallas avatar Sep 10 '23 10:09 mcdallas