Skip to content

Commit a00f333

Browse files
committed
add feature flag
1 parent 878f1d4 commit a00f333

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

Diff for: src/cascadia/TerminalSettingsModel/CascadiaSettingsSerialization.cpp

+11-8
Original file line numberDiff line numberDiff line change
@@ -183,16 +183,19 @@ void SettingsLoader::GenerateProfiles()
183183
PowershellCoreProfileGenerator powerShellGenerator{};
184184
_executeGenerator(powerShellGenerator);
185185

186-
const auto isPowerShellInstalled = !powerShellGenerator.GetPowerShellInstances().empty();
187-
if (!isPowerShellInstalled)
186+
if (Feature_PowerShellInstallerProfileGenerator::IsEnabled())
188187
{
189-
// Only generate the installer stub profile if PowerShell isn't installed.
190-
PowershellInstallationProfileGenerator pwshInstallationGenerator{};
191-
_executeGenerator(pwshInstallationGenerator);
188+
const auto isPowerShellInstalled = !powerShellGenerator.GetPowerShellInstances().empty();
189+
if (!isPowerShellInstalled)
190+
{
191+
// Only generate the installer stub profile if PowerShell isn't installed.
192+
PowershellInstallationProfileGenerator pwshInstallationGenerator{};
193+
_executeGenerator(pwshInstallationGenerator);
194+
}
195+
196+
// Regardless of running the installer's generator, we need to do some cleanup still.
197+
_cleanupPowerShellInstaller(isPowerShellInstalled);
192198
}
193-
194-
// Regardless of running the installer's generator, we need to do some cleanup still.
195-
_cleanupPowerShellInstaller(isPowerShellInstalled);
196199
}
197200

198201
WslDistroGenerator wslGenerator{};

Diff for: src/features.xml

+12
Original file line numberDiff line numberDiff line change
@@ -197,4 +197,16 @@
197197
<alwaysDisabledReleaseTokens/>
198198
</feature>
199199

200+
<feature>
201+
<name>Feature_PowerShellInstallerProfileGenerator</name>
202+
<description>Enables the PowerShell Installer Dynamic Profile Generator</description>
203+
<id>18639</id>
204+
<stage>AlwaysDisabled</stage>
205+
<alwaysEnabledBrandingTokens>
206+
<brandingToken>Dev</brandingToken>
207+
<brandingToken>Canary</brandingToken>
208+
<brandingToken>Preview</brandingToken>
209+
</alwaysEnabledBrandingTokens>
210+
</feature>
211+
200212
</featureStaging>

0 commit comments

Comments
 (0)