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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…