◐ Shell
clean mode source ↗

[release/v7.4.16] Update PowerShell telemetry to respect the diagnostics and feedback setting on Windows by adityapatwardhan · Pull Request #27430 · PowerShell/PowerShell

Backport of #27328 to release/v7.4.16

Triggered by @adityapatwardhan on behalf of @daxian-dbw

Original CL Label: CL-General

/cc @PowerShell/powershell-maintainers

Impact

REQUIRED: Choose either Tooling Impact or Customer Impact (or both). At least one checkbox must be selected.

Tooling Impact

  • Required tooling change
  • Optional tooling change (include reasoning)

No tooling workflow changes required for consumers; this backport updates runtime telemetry initialization behavior and ETW manifest/resources.

Customer Impact

  • Customer reported
  • Found internally

Ensures telemetry behavior on Windows respects the diagnostics and feedback setting, aligning with expected privacy/collection controls.

Regression

REQUIRED: Check exactly one box.

  • Yes
  • No

This is not a regression.

Testing

Cherry-pick applied with one conflict in Telemetry.cs resolved to preserve release-branch initialization while adding diagnostics-setting gating. Included telemetry test updates from the original PR; build and CI validation will run on the backport PR.

Risk

REQUIRED: Check exactly one box.

  • High
  • Medium
  • Low

Touches telemetry initialization and ETW related code paths on Windows; behavior change is intentional but affects startup/telemetry enabling logic.

Merge Conflicts

Resolved a conflict in src/System.Management.Automation/utils/Telemetry.cs by combining release/v7.4.16 branch structure with the original PR's Windows diagnostics-and-feedback gate logic, then completed cherry-pick without remaining conflict markers.