I am Trying To add a System Variable here using PowerShell:
I have tried both ways using
$env:MyTestVariable = "My test variable."
and
[Environment]::SetEnvironmentVariable("TestVariableName", "My Value", "<option>")
However neither of them seem to add to this section. I have tried restarting the computer as well to see if it would take effect then. I have looked at technet along with countless other websites, but nothing I have tried has worked.
How can I set a system variable with PowerShell?