{
  "schemaVersion": "ebb.rule.v1",
  "id": "shell.powershell.end-of-life-7.2",
  "ecosystem": "shell",
  "purl": "pkg:generic/powershell",
  "affectedVersions": "vers:semver/>=7.2.0|<7.3.0",
  "event": "end-of-life",
  "severity": "high",
  "title": "PowerShell 7.2 (LTS) is no longer supported",
  "summary": "Microsoft's PowerShell support lifecycle lists 7.2 LTS (built on .NET 6.0) as retired: support ended on 2024-11-08, so it receives no further updates, including security updates. A script or manifest that requires 7.2 targets an unsupported release.",
  "replacement": "PowerShell 7.6 (LTS) or later",
  "deadline": "2024-11-08",
  "sources": [
    {
      "title": "PowerShell support lifecycle",
      "url": "https://learn.microsoft.com/powershell/scripting/install/powershell-support-lifecycle",
      "accessedAt": "2026-10-22"
    }
  ],
  "provenance": {
    "observedAt": "2026-10-22",
    "reviewedAt": "2026-10-22",
    "reviewer": "arminazimi"
  },
  "migration": {
    "constraints": [
      "Raising a minimum version in `#Requires -Version` or `PowerShellVersion` stops the script or module from loading on any host that still runs PowerShell 7.2. Confirm every runner, container, and developer machine that executes it can run the target first.",
      "Scripts written for Windows PowerShell 5.1 often rely on Windows-only modules and cmdlets. Test them on PowerShell 7 before dropping 5.1 support, and keep a separate minimum for modules that must still load on Windows PowerShell.",
      "Update the declaration to a supported release from the replacement. These are suggested changes; nothing applies them automatically."
    ],
    "steps": [
      {
        "id": "inventory-hosts",
        "title": "Find where the script runs",
        "instructions": "List the CI jobs, container images, scheduled tasks, and developer setups that execute the reported file, and note which of them still provide PowerShell 7.2.",
        "targets": "all"
      },
      {
        "id": "install-target",
        "title": "Install the target PowerShell",
        "instructions": "Install a supported PowerShell 7 release (the replacement) on those hosts, or change the pinned mcr.microsoft.com/powershell image tag in the workflow to a supported tag.",
        "targets": "all"
      },
      {
        "id": "raise-declared-version",
        "title": "Raise the declared version",
        "instructions": "Change `#Requires -Version` or `PowerShellVersion` on the reported line to the minimum release the code truly needs, and no lower than a supported release. Do this in every script, module manifest, and workflow image that states the old version.",
        "targets": "declaration"
      },
      {
        "id": "run-tests",
        "title": "Run the scripts and tests on the new release",
        "instructions": "Run the script, its Pester tests, and any module import on the target release, and fix breaking changes in cmdlet behavior or removed APIs.",
        "targets": "all"
      }
    ],
    "verification": [
      {
        "command": "pwsh -NoProfile -Command \"$PSVersionTable\"",
        "purpose": "Show the PowerShell version and edition that will run the script, and confirm it is a supported release."
      },
      {
        "command": "pwsh -NoProfile -Command \"Get-Module -ListAvailable | Select-Object Name, Version, PowerShellVersion\"",
        "purpose": "List installed modules and the PowerShell versions they require, to confirm none still demands the old release."
      }
    ]
  }
}
