Repository navigation
7.5-rc1 SetEnvironmentVariable breaking change, feature or bug? #24605
Answered
by
iSazonov
Roman Kuzmin 1967-2026 (nightroman)
asked this question in
Q&A
|
The following code produces different results in 7.4.6 and 7.5-rc1. $name = 'TEST_VAR2'
$value = $null
[Environment]::SetEnvironmentVariable($name, $value)
$result = $env:TEST_VAR2
# PS 7.4.6 True
# PS 7.5.0 False
$null -eq $resultIf this is a feature to stay, then it introduces some inconsistencies. $env:TEST_VAR2 = $null
$result = $env:TEST_VAR2
# True in all versions
$null -eq $result |
Answered by
iSazonov
Nov 20, 2024
Replies: 3 comments 8 replies
1 reply
|
Now there is a bug in 7.5.0 - env variable is not removed by |
6 replies
Answer selected by
nightroman
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Now there is a bug in 7.5.0 - env variable is not removed by
[Environment]::SetEnvironmentVariable($name, $null).