mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
merge PR #2183: support Pwsh in Shell Plugin (PowerShell 7.x)
This commit is contained in:
commit
2daed5023f
4 changed files with 30 additions and 3 deletions
|
|
@ -237,6 +237,19 @@ namespace Flow.Launcher.Plugin.Shell
|
|||
break;
|
||||
}
|
||||
|
||||
case Shell.Pwsh:
|
||||
{
|
||||
info.FileName = "pwsh.exe";
|
||||
if (_settings.LeaveShellOpen)
|
||||
{
|
||||
info.ArgumentList.Add("-NoExit");
|
||||
}
|
||||
info.ArgumentList.Add("-Command");
|
||||
info.ArgumentList.Add(command);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case Shell.RunCommand:
|
||||
{
|
||||
var parts = command.Split(new[]
|
||||
|
|
|
|||
|
|
@ -36,6 +36,6 @@ namespace Flow.Launcher.Plugin.Shell
|
|||
Cmd = 0,
|
||||
Powershell = 1,
|
||||
RunCommand = 2,
|
||||
|
||||
Pwsh = 3,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@
|
|||
HorizontalAlignment="Left">
|
||||
<ComboBoxItem>CMD</ComboBoxItem>
|
||||
<ComboBoxItem>PowerShell</ComboBoxItem>
|
||||
<ComboBoxItem>Pwsh</ComboBoxItem>
|
||||
<ComboBoxItem>RunCommand</ComboBoxItem>
|
||||
</ComboBox>
|
||||
<StackPanel Grid.Row="4" Orientation="Horizontal">
|
||||
|
|
|
|||
|
|
@ -68,10 +68,23 @@ namespace Flow.Launcher.Plugin.Shell
|
|||
_settings.ReplaceWinR = false;
|
||||
};
|
||||
|
||||
ShellComboBox.SelectedIndex = (int) _settings.Shell;
|
||||
ShellComboBox.SelectedIndex = _settings.Shell switch
|
||||
{
|
||||
Shell.Cmd => 0,
|
||||
Shell.Powershell => 1,
|
||||
Shell.Pwsh => 2,
|
||||
_ => ShellComboBox.Items.Count - 1
|
||||
};
|
||||
|
||||
ShellComboBox.SelectionChanged += (o, e) =>
|
||||
{
|
||||
_settings.Shell = (Shell) ShellComboBox.SelectedIndex;
|
||||
_settings.Shell = ShellComboBox.SelectedIndex switch
|
||||
{
|
||||
0 => Shell.Cmd,
|
||||
1 => Shell.Powershell,
|
||||
2 => Shell.Pwsh,
|
||||
_ => Shell.RunCommand
|
||||
};
|
||||
LeaveShellOpen.IsEnabled = _settings.Shell != Shell.RunCommand;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue