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
Activity
iSazonov commentedon Jan 20, 2018
/cc Dongbo Wang (@daxian-dbw) It seems you already improved the code.
daxian-dbw commentedon Jan 22, 2018
I verified the reproduce steps on PSCore 6.0.0 and the issue seems to be fixed:
Given that, I'm closing this issue. Paul Higinbotham (@PaulHigin) Feel free to re-open this issue if you think it's not fixed.
PaulHigin commentedon Jan 22, 2018
Dongbo Wang (@daxian-dbw) Why do we assume this is fixed? Please provide a link to the PR that fixed it.
daxian-dbw commentedon Jan 22, 2018
Here is the PR: #5791 The group policy cache was redesigned in that PR.
PaulHigin commentedon Jan 22, 2018
Thanks. Agreed that this is no longer an issue.