Skip to content

Installing PowerShell 7.0.0 GA removed my PS 6 install #12002

Closed

Description

After installing the 7.0.0 GA, I discovered that my PS 6.2 folder was empty. Is this intended?

I Installed using PowerShell-7.0.0-win-x64.msi

Expected behavior

I expected that my PowerShell 6 release would have been left in place.

Actual behavior

C:\Program Files\PowerShell\6 is empty.
Any shortcuts or tasks targeting that release are not broken.

Environment data

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

Activity

  1. added
    Issue-Question
    on Mar 4, 2020
  2. KaylorDave commented on Mar 4, 2020

    @KaylorDave

    Seconding this, I was rather surprised when my PowerShell 6 install was removed.

  3. rkeithhill commented on Mar 4, 2020

    @rkeithhill
    Collaborator

    Same here. Hmm...

  4. tommymaynard commented on Mar 4, 2020

    @tommymaynard
    Contributor

    I lost everything in /Program Files/PowerShell/6, 6.0.4, and 6-preview. Launching PowerShell 6.2.4 in the Windows Terminal resulted in "[error 0x80070002 when launching 'C:\Program Files\PowerShell\6\pwsh.exe'].

  5. KaylorDave commented on Mar 4, 2020

    @KaylorDave

    For anyone who comes across this, you can keep your 6 install side-by-side by just copying the PowerShell\6 folder somewhere else prior to installing 7. Doesn't help if you've already lost your 6 install though :(.

  6. techthoughts2 commented on Mar 4, 2020

    @techthoughts2

    Same. While excited for 7 we will have use for PowerShell 6 for some time. Wasn't expecting it to be removed.

  7. SteveL-MSFT commented on Mar 4, 2020

    @SteveL-MSFT
    Member

    Checking on this

  8. iSazonov commented on Mar 4, 2020

    @iSazonov
    Collaborator

    It was discussed long time ago and it is by design because we can have only single "main" version.

  9. rkeithhill commented on Mar 4, 2020

    @rkeithhill
    Collaborator

    Not sure that makes sense. What is the point then of installing into versioned directories: 6 and 7?

  10. KaylorDave commented on Mar 4, 2020

    @KaylorDave

    It's fine for there to only be one 'main' version advertised by GitHub or by installation scripts, but we still have a use for 6, why does it need to remove 6 on my local system when they run fine as separate executables?

  11. iSazonov commented on Mar 4, 2020

    @iSazonov
    Collaborator

    why does it need to remove 6 on my local system when they run fine as separate executables?

    Because it is design for MSI installer. If you want install 7.0 as SxS you must use ZIP package.

    I won’t be surprised if this is in the documentation.

  12. SteveL-MSFT commented on Mar 4, 2020

    @SteveL-MSFT
    Member

    Looks like I missed some team discussion on this or forgot about it. Anyways, the official answer is that PS7 is expected to be an update over PS6. So the current behavior is by-design. We'll make sure docs call it out explicitly.

  13. KevinMarquette commented on Mar 4, 2020

    @KevinMarquette
    ContributorAuthor

    I am fine with the $env:path getting cleared so you only get the latest when you run pwsh. But I don't think it should remove the 6 files. Any place we have a full path specified will be broken.

    This makes the install of 7 over 6 a dangerous upgrade that can break things even if it would have been compatible. We have been preaching the side by side nature of PowerShell to the community for a while now and deleting those files breaks that promise.

  14. KaylorDave commented on Mar 4, 2020

    @KaylorDave

    Because it is design for MSI installer. If you want install 7.0 as SxS you must use ZIP package.

    The MSI could have been designed with SxS as an option. Or it could have warned that it was going to remove 6.x versions.

  15. iSazonov commented on Mar 4, 2020

    @iSazonov
    Collaborator

    Please see PowerShell Committee conclution PowerShell/PowerShell-RFC#202 (comment)

  16. 3 remaining items

  17. iSazonov commented on Mar 4, 2020

    @iSazonov
    Collaborator

    The MSI could have been designed with SxS as an option.

    This will lead to bugs. PowerShell depends on some environment variables, which constantly leads to problems of coexistence, but the MSFT team is not yet ready to abandon these dependencies.

  18. iSazonov commented on Mar 4, 2020

    @iSazonov
    Collaborator

    Worth noting that on macOS and Linux, upgrading PowerShell through the package manager necessarily clobbers the previous install.

    And having the same experience on all platforms is very good UX.

  19. joeyaiello commented on Mar 4, 2020

    @joeyaiello
    Contributor

    This makes the install of 7 over 6 a dangerous upgrade that can break things even if it would have been compatible. We have been preaching the side by side nature of PowerShell to the community for a while now and deleting those files breaks that promise.

    From a code perspective, it's no more dangerous than us doing an in-place upgrade from 6.0 to 6.1 and then again to 6.2 (which we did do). The trade off here was against having a dangling 6.2 on your box that's out of support in <6 months and can't be upgraded to a supported, serviceable state.

    I hear everyone that we could have communicated better, and I can add some of this language to my announcement blog if folks think it would be helpful as a call out there.

  20. rjmholt commented on Mar 4, 2020

    @rjmholt
    Collaborator

    The trade off here was against having a dangling 6.2 on your box that's out of support in <6 months and can't be upgraded to a supported, serviceable state.

    FWIW this happened to me. Had 6.0.2 on my box and didn't realise for a year until I picked it up as a bug when writing this.

  21. austoonz commented on Mar 4, 2020

    @austoonz

    Perhaps an MSI installer flag should be added that allows the customer to "KeepExistingPwshVersions"?
    Then customers can decide at install time whether they want previous versions removed or not.

  22. jckenny commented on Mar 6, 2020

    @jckenny

    Will PowerShell 8 automatically remove 7 when that is released or will 7 not be touched because it is a long term support release?

  23. iSazonov commented on Mar 6, 2020

    @iSazonov
    Collaborator

    For next version numbering #12057

  24. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  25. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  26. microsoft-github-policy-service commented on Nov 16, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has not had any activity in 6 months, if this is a bug please try to reproduce on the latest version of PowerShell and reopen a new issue and reference this issue if this is still a blocker for you.

  27. added
    Resolution-No Activity
    on Nov 16, 2023
  28. microsoft-github-policy-service commented on Nov 23, 2023

    @microsoft-github-policy-service
    Contributor

    This issue has been marked as "No Activity" as there has been no activity for 6 months. It has been closed for housekeeping purposes.

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

    Issue-QuestionResolution-No Activity

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions