The internal Group Policy cache does not use a unique key and ends up returning MachinePolicy ExecutionPolicy for a UserPolicy query.
Update the cache code to use a fully unique key.
Investigate using a Tuple instead of concatenated string for the cache key to improve performance.
Steps to reproduce
Set Group Policy UserPolicy, ExecutionPolicy to RemoteSigned
Start new PowerShell session
Run 'Get-ExecutionPolicy -List'
Expected behavior
ExecutionPolicy UserPolicy set to RemoteSigned
Actual behavior
ExecutionPolicy UserPolicy set to Undefined
The internal Group Policy cache does not use a unique key and ends up returning MachinePolicy ExecutionPolicy for a UserPolicy query.
Update the cache code to use a fully unique key.
Investigate using a Tuple instead of concatenated string for the cache key to improve performance.
Steps to reproduce
Set Group Policy UserPolicy, ExecutionPolicy to RemoteSigned
Start new PowerShell session
Run 'Get-ExecutionPolicy -List'
Expected behavior
ExecutionPolicy UserPolicy set to RemoteSigned
Actual behavior
ExecutionPolicy UserPolicy set to Undefined