plugin/shell: add powershell core (pwsh) option

Co-authored-by: shobu13 <shobu13@hotmail.fr>
This commit is contained in:
Ioannis G 2023-06-12 16:18:23 +03:00
parent e6baa88002
commit c6a6c6bd5c
No known key found for this signature in database
GPG key ID: EAC0E4E5E36AC49E
4 changed files with 18 additions and 2 deletions

View file

@ -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[]

View file

@ -36,6 +36,6 @@ namespace Flow.Launcher.Plugin.Shell
Cmd = 0,
Powershell = 1,
RunCommand = 2,
Pwsh = 3,
}
}

View file

@ -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">

View file

@ -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;