mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
plugin/shell: add powershell core (pwsh) option
Co-authored-by: shobu13 <shobu13@hotmail.fr>
This commit is contained in:
parent
e6baa88002
commit
c6a6c6bd5c
4 changed files with 18 additions and 2 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">
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
|
|
@ -72,6 +72,7 @@ namespace Flow.Launcher.Plugin.Shell
|
|||
{
|
||||
Shell.Cmd => 0,
|
||||
Shell.Powershell => 1,
|
||||
Shell.Pwsh => 2,
|
||||
_ => ShellComboBox.Items.Count - 1
|
||||
};
|
||||
|
||||
|
|
@ -81,6 +82,7 @@ namespace Flow.Launcher.Plugin.Shell
|
|||
{
|
||||
0 => Shell.Cmd,
|
||||
1 => Shell.Powershell,
|
||||
2 => Shell.Pwsh,
|
||||
_ => Shell.RunCommand
|
||||
};
|
||||
LeaveShellOpen.IsEnabled = _settings.Shell != Shell.RunCommand;
|
||||
|
|
|
|||
Loading…
Reference in a new issue