reddsaver
reddsaver copied to clipboard
Windows username env fix doesn't work in Windows PowerShell (in contrast to the Command Prompt)
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.
After some hunting around, the following fix works
[System.Environment]::SetEnvironmentVariable('UserName', '', 'Process')
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