News for hackers. Stuff that matters.
Re:Three Years from GPT-3 to Gemini 3 by lenkite on Monday November 24, 2025 @10:05PM (#46041945)
First, that expression is overly complicated, shorten to:

    [Environment]::SetEnvironmentVariable($name, $value, "User")
You have un-necessarily used a full constant to falsely present it more complex. Please also note that you have COMPLETION. You are not forced to type that out. Second, you can use an alternative

    Set-Item HKCU:\Environment\MY_VAR "some value"
Third, if you still find it too long, wrap it in a function:

    function setenv($name, $value) {
       [Environment]::SetEnvironmentVariable($name, $value, "User")
    }

    setenv MY_VAR "some value"

Also, can you please tell the incantation for setting an env variable permanently in bash ? You cannot since it doesn't exist.

Powershell's model is far superior to Bash. It is not even a contest.

There are no comments on this comment yet.