Skip to content

PowerShell-Release : --tag v7.4.5 --version 7.4.5.0 is not upgrading or installing via winget from --source winget. Note: I am on PowerShell Core 7.4.4 #24237

Closed

Description

@iCanHazConfetti

Prerequisites

Steps to reproduce

I am having no luck installing or upgrading the v7.4.5 Release of PowerShell.

Here are some Software Versions that (may) be relevant?

  1. Windows Terminal : --id Microsoft.WindowsTerminal ; version : v1.21.2361.0 ; source : winget
  2. WinGet : version : v1.8.1911
  3. PowerShell : PS> $PSVersionTable :
    3.1. PSVersion : 7.4.4
    3.2. PSEdition : Core
    3.3. GitCommitId : 7.4.4
    3.4. OS : Microsoft Windows 10.0.19045
    3.5. Platform : Win32NT
    3.6. PSCompatibleVersions : {1.0, 2.0, 3.0, 4.0 ...}
    3.7. PSRemotingProtocolVersion : 2.3
    3.8. SerializationVersion : 1.1.0.1
    3.9. WSManStackVersion : 3.0

Expected behavior

PS> winget find --id Microsoft.PowerShell -s winget 
#<should find --id Microsoft.PowerShell -s winget --version 7.4.5.0>

PS> winget upgrade --id Microsoft.PowerShell -s winget
#<should upgrade --id Microsoft.PowerShell -s winget to --version 7.4.5.0>


Expected: Latest Release version of PowerShell (--tag v7.4.5) (--e v7.4.5.0) would upgrade the existing installed version (--version 7.4.4.0).

Actual behavior

PS> winget upgrade --id Microsoft.PowerShell -s winget 
#<the latest version should be defaulted to>
PS> No available upgrade found.
PS> No newer package versiona are available from the configured sources.

Actual: 
PS> winget find --id Microsoft.PowerShell -s winget -v 7.4.5.0 
#<DOES Find --id Microsoft.PowerShell -s winget -v 7.4.5.0 >
PS> winget upgrade --id Microsoft.PowerShell -s winget 
#<DOES NOT Find --id Microsoft.PowerShell -s winget -v 7.4.5.0>
#<ERRORS WITH: 
PS> No available upgrade found.
PS> No newer package versiona are available from the configured sources.
>

Error details

Get-Error returns Nothing.

Environment data

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.4.4
PSEdition                      Core
GitCommitId                    7.4.4
OS                             Microsoft Windows 10.0.19045
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

Activity

  1. added
    Needs-Triage
    on Aug 31, 2024
  2. kilasuit commented on Aug 31, 2024

    @kilasuit
  3. removed
    Needs-Triage
    on Aug 31, 2024
  4. kilasuit commented on Aug 31, 2024

    @kilasuit
    Collaborator

    accidental keyboard combo closed it

  5. added
    Needs-Triage
    on Aug 31, 2024
  6. kilasuit commented on Sep 10, 2024

    @kilasuit
    Collaborator

    This was a fun one to dig into & I'm pretty certain I have managed to understand and I believe replicate what has been happening for iCanHazConfetti in this issue as well as in #23970 & in #24111
    There is a possibility this behaviour may continue to happen for future releases, however, I do think that this can be avoided for others but likely needs a change in how Microsoft Update Installs the preview version and actually correctly identifies it as the preview package not the stable package.

    Key points

    • Stable and Preview versions have been installed either via winget or other means & then crucially have not been updated by winget but most likely been updated by Microsoft Update
    • When Microsoft Update runs
      • Preview version 7.5.1.0 gets "upgraded" to a newly installed Package Name of PowerShell 7.5.2.0-x64
        • winget sees these "upgrades" as a Microsoft.PowerShell package & not Microsoft.PowerShell.Preview package
      • Stable version 7.4.2 gets "upgraded to a newly installed Package Name of PowerShell 7.4.3.0-x64
        • winget sees these "upgrades" as a Microsoft.PowerShell package as expected

    The conflict here in what winget sees is why winget upgrade does not work

    I think the only fix here for iCanHazConfetti is to get winget is to force a fresh install by not using winget upgrade here & optionally attempt to uninstall previous versions too

    • stable winget install --id Microsoft.PowerShell -s winget -v 7.4.5.0 --uninstall-previous --force
      • this should remove the lingering old version 7.3.8.0 if not then running winget uninstall --id Microsoft.PowerShell -v 7.3.8.0 should do it
    • preview winget install --id Microsoft.PowerShell.Preview -s winget -v 7.5.0.4 --uninstall-previous --force

    Pain points in investigating

    • inability to tell winget not to try manage an installed application (I am raising another issue for this in the winget repo)
    • metadata clashes between what winget sees re package name & upgradable versions
    • releases to winget are delayed from when the new release notification popup shows to users
    • preview releases aren't installed by Microsoft Update as PowerShell Preview - 7.5.0.4 which is a potential bug - confirmed by downloading and installing the update package from Microsoft Update Catalog
      • Example being that 7.5.0-preview2 is installed as PowerShell 7.5.2.0-x64
    • missing metadata for v7.4.3 in the update catalog too
      image

    Notes

    I noticed that you have a 7.4x (stable) and 7.5x (preview) versions on your machine & an older 7.3.8 install from an image that you shared in this #24111 (comment)
    In my testing it looks to me that both 7.3.x and 7.5.x (no matter how they'd been installed) had been updated via Microsoft Update. I noticed this as the version numbers are returned as part of the Name via winget list --id Microsoft.PowerShell which I have seen on a number of my machines when it is allowed to be updated by Microsoft Update.

    I then noticed that when you install PowerShell via winget, which I did across multiple machines & sandboxes to be sure, the name of the package returned by winget is as follows
    image

    If you install the update package for 7.5.0-preview.2 winget will incorrectly ID it as not being the Microsoft.PowerShell.Preview package - which is a bug Steve Lee (@SteveL-MSFT) that I don't know where this needs raised to be fixed
    image

    The writeup on this would not have taken so long if I wasn't having issues with my laptop & thankfully my comments here in GitHub between reboots and shutdowns where saved & not lost

  7. iCanHazConfetti commented on Sep 16, 2024

    @iCanHazConfetti
    Author

    This was a fun one to dig into & I'm pretty certain I have managed to understand and I believe replicate what has been happening for iCanHazConfetti in this issue as well as in #23970 & in #24111 There is a possibility this behaviour may continue to happen for future releases, however, I do think that this can be avoided for others but likely needs a change in how Microsoft Update Installs the preview version and actually correctly identifies it as the preview package not the stable package.

    Key points

    • Stable and Preview versions have been installed either via winget or other means & then crucially have not been updated by winget but most likely been updated by Microsoft Update

    • When Microsoft Update runs

      • Preview version 7.5.1.0 gets "upgraded" to a newly installed Package Name of PowerShell 7.5.2.0-x64

        • winget sees these "upgrades" as a Microsoft.PowerShell package & not Microsoft.PowerShell.Preview package
      • Stable version 7.4.2 gets "upgraded to a newly installed Package Name of PowerShell 7.4.3.0-x64

        • winget sees these "upgrades" as a Microsoft.PowerShell package as expected

    The conflict here in what winget sees is why winget upgrade does not work

    I think the only fix here for iCanHazConfetti is to get winget is to force a fresh install by not using winget upgrade here & optionally attempt to uninstall previous versions too

    • stable winget install --id Microsoft.PowerShell -s winget -v 7.4.5.0 --uninstall-previous --force

      • this should remove the lingering old version 7.3.8.0 if not then running winget uninstall --id Microsoft.PowerShell -v 7.3.8.0 should do it
    • preview winget install --id Microsoft.PowerShell.Preview -s winget -v 7.5.0.4 --uninstall-previous --force

    Pain points in investigating

    • inability to tell winget not to try manage an installed application (I am raising another issue for this in the winget repo)

    • metadata clashes between what winget sees re package name & upgradable versions

    • releases to winget are delayed from when the new release notification popup shows to users

    • preview releases aren't installed by Microsoft Update as PowerShell Preview - 7.5.0.4 which is a potential bug - confirmed by downloading and installing the update package from Microsoft Update Catalog

      • Example being that 7.5.0-preview2 is installed as PowerShell 7.5.2.0-x64
    • missing metadata for v7.4.3 in the update catalog too
      image

    Notes

    I noticed that you have a 7.4x (stable) and 7.5x (preview) versions on your machine & an older 7.3.8 install from an image that you shared in this #24111 (comment) In my testing it looks to me that both 7.3.x and 7.5.x (no matter how they'd been installed) had been updated via Microsoft Update. I noticed this as the version numbers are returned as part of the Name via winget list --id Microsoft.PowerShell which I have seen on a number of my machines when it is allowed to be updated by Microsoft Update.

    I then noticed that when you install PowerShell via winget, which I did across multiple machines & sandboxes to be sure, the name of the package returned by winget is as follows image

    If you install the update package for 7.5.0-preview.2 winget will incorrectly ID it as not being the Microsoft.PowerShell.Preview package - which is a bug Steve Lee (@SteveL-MSFT) that I don't know where this needs raised to be fixed image

    The writeup on this would not have taken so long if I wasn't having issues with my laptop & thankfully my comments here in GitHub between reboots and shutdowns where saved & not lost

    THESE COMMANDS WORKED :

    PowerShell Stable Release :
    PS> winget install --id Microsoft.PowerShell -s winget -v 7.4.5.0 --uninstall-previous --force

    This should remove the lingering old version 7.3.8.0
    <IT DID, THIS DID WORK ON MY MACHINE>

    if not then running winget uninstall --id Microsoft.PowerShell -v 7.3.8.0 should do it

    PowerShell Preview Release :
    PS> winget install --id Microsoft.PowerShell.Preview -s winget -v 7.5.0.4 --uninstall-previous --force

    This should remove the lingering old version 7.5.0.-preview.2
    <IT DID, THIS WORKED ON MY MACHINE>

    if not then running winget uninstall --id Microsoft.PowerShell -v 7.3.8.0 should do it

    -- iCanHazConfetti

  8. added
    Resolution-Answered
    Resolution-External
    and removed
    Needs-Triage
    on Oct 24, 2024
  9. microsoft-github-policy-service commented on Oct 25, 2024

    @microsoft-github-policy-service
    Contributor

    This issue has been marked as external and has not had any activity for 1 day. It has been be closed for housekeeping purposes.

  10. microsoft-github-policy-service commented on Oct 25, 2024

    @microsoft-github-policy-service
    Contributor

    This issue has been marked as answered and has not had any activity for 1 day. It has been closed for housekeeping purposes.

  11. microsoft-github-policy-service commented on Oct 25, 2024

    @microsoft-github-policy-service
    Contributor

    📣 Hey iCanHazConfetti, how did we do? We would love to hear your feedback with the link below! 🗣️

    🔗 https://aka.ms/PSRepoFeedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution-AnsweredResolution-External

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions