Terminal: Add additional PowerShell Core paths (preview, scoop, etc.) to dynamic profile generator

Created on 6 Aug 2019  路  16Comments  路  Source: microsoft/terminal

depends on #754


Description of the new feature/enhancement

To include PowerShell 7 Preview.2 in the list of consoles if is already installed in the system.


I got both PowerShell Core GA and Preview installed for some time. And, the last few updates of Windows Terminal, is not automatically showing in the console list.

WinTerm_01_2019-08-06_15-40-58

WinTerm_02_2019-08-06_15-40-58

WinTerm_03_2019-08-06_15-40-58

Area-Settings Issue-Task Product-Terminal Resolution-Fix-Committed

Most helpful comment

Well yes, again, this is because you鈥檙e using a released version of Terminal that predates this feature being added and this bug being closed. That is how we handle all bugs in this repository: they are closed when the code change is made, and an announcement is posted when a release is available that contains the change.

All 16 comments

We should handle this as part of a powershell core dynamic profile generator!

Therefore, I am converting this issue to be the master task for "Switch PSCore to a dynamic profile generator".

@zadjii-msft - thoughts:

  • Should this stay open? If so:

    • Move out from 1909

    • Make it generate a bunch of different PSCore profiles

    • Add support for scoop?

    • integrate the preview icon, detect preview versions

    • make pscore {latest} the default version

Eh, yea this should probably be re-purposed for those things.

Frankly I don't know enough about PSCore to implement preview, scoop, etc. support myself, but I'm sure that an enterprising community member could always update the PowershellCoreProfileGenerator if they wanted to add additional search locations 馃槣

I'm taking a crack at this!

image

The "latest good" (determined by a sorting algorithm ;P) one gets the legacy "Powershell Core" GUID :)

        // Total sort order:
        // 6-preview (wow) < 6-preview (native) < 7-preview (native) < 6 (wow) < 6 (native) < 7 (native)
        uint8_t Radix() const
        {
            return (preview ? 0b00000000 : 0b10000000) | ((majorVersion - 6) << 4) | (nativeArchitecture ? 0b1000 : 0x0000);
        }

@stevel-msft quick questions I wanted to run by you, all related to powershell branding.

When we're generating automatic profiles for Powershell instances:

  • Should we include any version numbers past the first? (6, 6.2, 6.2.3)
  • Should we use the casing PowerShell or Powershell?
  • Should we use the name PowerShell or PowerShell Core?

    • I've implemented it as follows:



      • 6.x = "PowerShell Core"


      • 7+ = "PowerShell"



  • Is it safe for us to assume that assets\ will always be present in the powershell distribution directory?
  • If the user has installed pwsh as a dotnet global tool, should we prefer that _over_ or _under_ the Program Files one?

Right now, my total global sort order is this:

7 (x64/arm64 native)
6 (x64/arm64 native)
6 (x86)
7-preview (x64/arm64 native)
6-preview (x64/arm64 native)
6-preview (x86)

I'm not sure where to slot "program files", "dotnet global" and "windows store" to the sort order. :smile:

@DHowett-MSFT Casing is "PowerShell" always. I wouldn't show version numbers. You're saying "Core" is dropped after 7 is released? I'd prefer the pwsh.exe that is first in the path.

From a branding perspective, I would suggest differentiating:

  • PowerShell Core 6.1
  • PowerShell Core 6.2
  • PowerShell 7
  • PowerShell 7-Preview

(6.0 is out of support already)

I don't think 6.x-Preview is needed since we have stable releases of those and no more previews for 6.x ever.

image

After doing this it doesn't appear in the list of profiles... Am I missing something?

Unless you鈥檙e running the latest internal-to-microsoft build that was released last night around midnight, you鈥檙e missing a version of Windows Terminal that actually has this feature in it 馃槄

(If you aren鈥檛: check the store for updates, then hit me back!)

Windows Terminal version 0.8.10261.0

My dilemma has been that I want to use Windows Terminal with both PowerShell GA and Preview versions. But it seems that I can't, as it only pick one of the installed version.

WinTerm_01_2020-02-01_15-20-06

If I remove the GA version, then it grabs the Preview:

WinTerm_02_2020-02-01_15-20-06

Well yes, again, this is because you鈥檙e using a released version of Terminal that predates this feature being added and this bug being closed. That is how we handle all bugs in this repository: they are closed when the code change is made, and an announcement is posted when a release is available that contains the change.

Thank You All for your hard work! I love Windows Terminal.

:tada:This issue was addressed in #4273, which has now been successfully released as Windows Terminal Preview v0.9.433.0.:tada:

Handy links:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghvanderweg picture ghvanderweg  路  3Comments

mdtauk picture mdtauk  路  3Comments

waf picture waf  路  3Comments

DieselMeister picture DieselMeister  路  3Comments

ghost picture ghost  路  3Comments