This pull request teaches the PowerShell Core generator about a bunch of different locations in which it might find a PowerShell. These instances will be sorted, a leader will be elected, and that leader will be promoted and given the vaunted title of "PowerShell". Names will be generated for the rest. The sort order is documented in the comments, but that comment will be replicated here: ``` // <-- Less Valued .................................... More Valued --> // | All instances of PS 6 | All PS7 | // | Preview | Stable | ~~~ | // | Non-Native | Native | Non-Native | Native | ~~~ | // | Trd | Pack | Trd | Pack | Trd | Pack | Trd | Pack | ~~~ | // (where Pack is a stand-in for store, scoop, dotnet, though they have their own orders, // and Trd is a stand-in for "Traditional" (Program Files)) ``` Closes #2300
33 lines
769 B
C++
33 lines
769 B
C++
/*++
|
|
Copyright (c) Microsoft Corporation
|
|
Licensed under the MIT license.
|
|
|
|
Module Name:
|
|
- PowershellCoreProfileGenerator
|
|
|
|
Abstract:
|
|
- This is the dynamic profile generator for PowerShell Core. Checks if pwsh is
|
|
installed, and if it is, creates a profile to launch it.
|
|
|
|
Author(s):
|
|
- Mike Griese - August 2019
|
|
|
|
--*/
|
|
|
|
#pragma once
|
|
|
|
#include "IDynamicProfileGenerator.h"
|
|
|
|
namespace TerminalApp
|
|
{
|
|
class PowershellCoreProfileGenerator : public TerminalApp::IDynamicProfileGenerator
|
|
{
|
|
public:
|
|
PowershellCoreProfileGenerator() = default;
|
|
~PowershellCoreProfileGenerator() = default;
|
|
std::wstring_view GetNamespace() override;
|
|
|
|
std::vector<TerminalApp::Profile> GenerateProfiles() override;
|
|
};
|
|
};
|