Skip to content

Commit bba0527

Browse files
authored
Collect all known PowerShell Core installations for dynamic profiles (#4273)
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
1 parent 06e9605 commit bba0527

11 files changed

+291
-55
lines changed
467 Bytes
Loading
606 Bytes
Loading
680 Bytes
Loading
809 Bytes
Loading
750 Bytes
Loading
1.03 KB
Loading
989 Bytes
Loading
1.33 KB
Loading

src/cascadia/TerminalApp/PowershellCoreProfileGenerator.cpp

Lines changed: 290 additions & 51 deletions
Large diffs are not rendered by default.

src/cascadia/TerminalApp/PowershellCoreProfileGenerator.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,5 @@ namespace TerminalApp
2828
std::wstring_view GetNamespace() override;
2929

3030
std::vector<TerminalApp::Profile> GenerateProfiles() override;
31-
32-
private:
33-
static bool _isPowerShellCoreInstalled(std::filesystem::path& cmdline);
34-
static bool _isPowerShellCoreInstalledInPath(const std::wstring_view programFileEnv, std::filesystem::path& cmdline);
3531
};
3632
};

0 commit comments

Comments
 (0)