Skip to content

Logging of script block execution cannot be enabled on Unix #5695

@daxian-dbw

Description

@daxian-dbw

PowerShell checks whether to log script block activities in ShouldLogScriptBlockActivity, which query Registry on windows to get the configuration via GetGroupPolicySetting. However, GetGroupPolicySetting does nothing on Unix, and thus script block activity logging cannot be enabled on Unix.

A potential fix is to make PowerShell checks against an entry in pwsh.runtimeconfig.json.

Metadata

Metadata

Assignees

Labels

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

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions