Skip to content

Fix group policy cache #2877

@PaulHigin

Description

@PaulHigin

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-FixedThe issue is fixed.WG-Enginecore PowerShell engine, interpreter, and runtime

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions