Only return environment variable names that have an associated value from Get-EnvironmentVariableNames
When calling Update-SessionEnvironment, don't call SetVariable if the value at the queried scope is null.
Motivation and Context
.NET's registry handling seems to get value names around that have been set to null previously in the session, causing issues with the UpdateSession logic path.
Testing
Testing in test kitchen where we noticed the issue.
Operating Systems Testing
Windows Server 2016 & 2019
Change Types Made
[x] Bug fix (non-breaking change).
[ ] Feature / Enhancement (non-breaking change).
[ ] Breaking change (fix or feature that could cause existing functionality to change).
Description Of Changes
Motivation and Context
Testing
Testing in test kitchen where we noticed the issue.
Operating Systems Testing
Windows Server 2016 & 2019
Change Types Made
Change Checklist
Related Issue
310