Skip to content

GDPR consent problem: PowerShell 7.4.5 installer forcefully enables telemetry on upgrade even if previous version was installed with telemetry disabled #21467

@R-Adrian

Description

@R-Adrian

Prerequisites

Steps to reproduce

  • if an existing version of PowerShell 7 is installed then uninstall it from control panel.
  • make sure there is no C:\Program Files\PowerShell\7 folder left
  • download and install the immediately previous version
    (e.g. 7.4.1 in our case here https://github.com/PowerShell/PowerShell/releases/download/v7.4.1/PowerShell-7.4.1-win-x64.msi )
  • install that version. When installing make sure to enable the checkbox for opt out, to disable telemetry.
  • start pwsh, check the output of the $env:POWERSHELL_TELEMETRY_OPTOUT environment variable
    (it shows 1 in my case)

for testing silent / unattended upgrade - make sure pwsh 7 is not running, start an elevated cmd.exe command prompt, run winget upgrade Microsoft.PowerShell - and update pwsh to version 7.4.2 ( https://github.com/PowerShell/PowerShell/releases/download/v7.4.2/PowerShell-7.4.2-win-x64.msi )

for testing interactive upgrade: run the MSI installer manually - the same result can be observed - the telemetry preference is reset to defaut (i.e. the checkbox is disabled in the MSI installer running an upgrade).

  • after the upgrade start pwsh and check the output of that environment variable again - after the winget silent/unattended update it shows no optout (i.e. the telemetry is now forcefully enabled again)

Expected behavior

telemetry remains disabled

Actual behavior

telemetry is forcefully enabled for either interactive updates (the opt out preference is not used by the MSI installer) or silent / unattended updates

Error details

installer issue

Environment data

(MSI installer issue - env not really relevant)

Visuals

PowerShell telemetry reference:
https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_telemetry?view=powershell-7.4

PowerShell 7.4.1 manual installation of the MSI file, with telemetry disabled:
PowerShell 7.4.1 installation with telemetry disabled

checking before upgrade...
pwsh_741_before_upgrade

and running winget upgrade Microsoft.PowerShell (using the old Windows PowerShell instead of cmd.exe as a console window)

pwsh_742_winget_upgrade_

... PowerShell 7 telemetry optout is now disabled and the variable is not defined anymore - this means that telemetry was forcefully enabled during the upgrade.

pwsh_742_after_upgrade

Metadata

Metadata

Labels

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