Compare commits

...

1 Commits

Author SHA1 Message Date
Leonard Hecker
f9bf1ffa58 Add a version suffix to the Windows Powershell profile 2026-04-21 15:09:47 +02:00
8 changed files with 20 additions and 10 deletions

View File

@@ -595,7 +595,7 @@ namespace TerminalAppLocalTests
}
{
AppCommandlineArgs appArgs{};
std::vector<const wchar_t*> rawCommands{ L"wt.exe", subcommand, L"-p", L"Windows PowerShell" };
std::vector<const wchar_t*> rawCommands{ L"wt.exe", subcommand, L"-p", L"Windows PowerShell 5.1" };
_buildCommandlinesHelper(appArgs, 1u, rawCommands);
VERIFY_ARE_EQUAL(1u, appArgs._startupActions.size());
@@ -613,7 +613,7 @@ namespace TerminalAppLocalTests
VERIFY_IS_NULL(terminalArgs.TabColor());
VERIFY_IS_NULL(terminalArgs.ProfileIndex());
VERIFY_IS_FALSE(terminalArgs.Profile().empty());
VERIFY_ARE_EQUAL(L"Windows PowerShell", terminalArgs.Profile());
VERIFY_ARE_EQUAL(L"Windows PowerShell 5.1", terminalArgs.Profile());
VERIFY_IS_TRUE(terminalArgs.ColorScheme().empty());
}
{

View File

@@ -667,6 +667,16 @@ bool SettingsLoader::FixupUserSettings()
}
}
}
// MSFT-59472435: Rename "Windows PowerShell" to "Windows PowerShell 5.1"
// to avoid confusion with PowerShell 7+ (aka pwsh).
// TODO: This can be removed in ~2028?
static constexpr winrt::guid powershell51{ 0x61c54bbd, 0xc2c6, 0x5271, { 0x96, 0xe7, 0x00, 0x9a, 0x87, 0xff, 0x44, 0xbf } };
if (profile->Guid() == powershell51 && profile->HasName() && profile->Name() == L"Windows PowerShell")
{
profile->Name(L"Windows PowerShell 5.1");
fixedUp = true;
}
}
// Terminal 1.19: Migrate the global

View File

@@ -502,7 +502,7 @@ void Profile::_logSettingIfSet(const std::string_view& setting, const bool isSet
// Exclude some false positives from userDefaults.json
// NOTE: we can't use the OriginTag here because it hasn't been set yet!
const bool isWinPow = _Guid.has_value() && *_Guid == DEFAULT_WINDOWS_POWERSHELL_GUID; //_Name.has_value() && til::equals_insensitive_ascii(*_Name, L"Windows PowerShell");
const bool isWinPow = _Guid.has_value() && *_Guid == DEFAULT_WINDOWS_POWERSHELL_GUID; //_Name.has_value() && til::equals_insensitive_ascii(*_Name, L"Windows PowerShell 5.1");
const bool isCmd = _Guid.has_value() && *_Guid == DEFAULT_COMMAND_PROMPT_GUID; //_Name.has_value() && til::equals_insensitive_ascii(*_Name, L"Command Prompt");
const bool isACS = _Name.has_value() && til::equals_insensitive_ascii(*_Name, L"Azure Cloud Shell");
const bool isWTDynamicProfile = _Source.has_value() && til::starts_with(*_Source, L"Windows.Terminal");

View File

@@ -37,7 +37,7 @@
[
{
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"name": "Windows PowerShell 5.1",
"commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"icon": "ms-appx:///ProfileIcons/{61c54bbd-c2c6-5271-96e7-009a87ff44bf}.png",
"colorScheme": "Campbell",

View File

@@ -9,7 +9,7 @@
[
{
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"name": "Windows PowerShell 5.1",
"commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
"hidden": false
},

View File

@@ -550,7 +550,7 @@ namespace SettingsModelUnitTests
VERIFY_ARE_EQUAL(L"profile0", settings->AllProfiles().GetAt(0).Name());
VERIFY_ARE_EQUAL(L"profile1", settings->AllProfiles().GetAt(1).Name());
VERIFY_ARE_EQUAL(L"cmdFromUserSettings", settings->AllProfiles().GetAt(2).Name());
VERIFY_ARE_EQUAL(L"Windows PowerShell", settings->AllProfiles().GetAt(3).Name());
VERIFY_ARE_EQUAL(L"Windows PowerShell 5.1", settings->AllProfiles().GetAt(3).Name());
}
void DeserializationTests::TestReorderingWithoutGuid()
@@ -628,7 +628,7 @@ namespace SettingsModelUnitTests
VERIFY_ARE_EQUAL(L"Command Prompt", settings->AllProfiles().GetAt(0).Name());
VERIFY_ARE_EQUAL(L"ThisProfileShouldNotCrash", settings->AllProfiles().GetAt(1).Name());
VERIFY_ARE_EQUAL(L"Ubuntu", settings->AllProfiles().GetAt(2).Name());
VERIFY_ARE_EQUAL(L"Windows PowerShell", settings->AllProfiles().GetAt(3).Name());
VERIFY_ARE_EQUAL(L"Windows PowerShell 5.1", settings->AllProfiles().GetAt(3).Name());
}
void DeserializationTests::TestLayeringNameOnlyProfiles()
@@ -660,7 +660,7 @@ namespace SettingsModelUnitTests
VERIFY_ARE_EQUAL(L"ThisProfileIsGood", profiles.GetAt(0).Name());
VERIFY_ARE_EQUAL(L"ThisProfileShouldNotLayer", profiles.GetAt(1).Name());
VERIFY_ARE_EQUAL(L"NeitherShouldThisOne", profiles.GetAt(2).Name());
VERIFY_ARE_EQUAL(L"Windows PowerShell", profiles.GetAt(3).Name());
VERIFY_ARE_EQUAL(L"Windows PowerShell 5.1", profiles.GetAt(3).Name());
VERIFY_ARE_EQUAL(L"Command Prompt", profiles.GetAt(4).Name());
}

View File

@@ -411,7 +411,7 @@ namespace SettingsModelUnitTests
"profiles": [
{
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"name": "Windows PowerShell 5.1",
"commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
},
{

View File

@@ -149,7 +149,7 @@ namespace SettingsModelUnitTests
{
static constexpr std::string_view profileString{ R"(
{
"name": "Windows PowerShell",
"name": "Windows PowerShell 5.1",
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",