Skip to content

Commit c6a6c6b

Browse files
JohnTheGr8shobu13
andcommitted
plugin/shell: add powershell core (pwsh) option
Co-authored-by: shobu13 <[email protected]>
1 parent e6baa88 commit c6a6c6b

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

Plugins/Flow.Launcher.Plugin.Shell/Main.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,19 @@ private ProcessStartInfo PrepareProcessStartInfo(string command, bool runAsAdmin
237237
break;
238238
}
239239

240+
case Shell.Pwsh:
241+
{
242+
info.FileName = "pwsh.exe";
243+
if (_settings.LeaveShellOpen)
244+
{
245+
info.ArgumentList.Add("-NoExit");
246+
}
247+
info.ArgumentList.Add("-Command");
248+
info.ArgumentList.Add(command);
249+
250+
break;
251+
}
252+
240253
case Shell.RunCommand:
241254
{
242255
var parts = command.Split(new[]

Plugins/Flow.Launcher.Plugin.Shell/Settings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ public enum Shell
3636
Cmd = 0,
3737
Powershell = 1,
3838
RunCommand = 2,
39-
39+
Pwsh = 3,
4040
}
4141
}

Plugins/Flow.Launcher.Plugin.Shell/ShellSetting.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
HorizontalAlignment="Left">
4242
<ComboBoxItem>CMD</ComboBoxItem>
4343
<ComboBoxItem>PowerShell</ComboBoxItem>
44+
<ComboBoxItem>Pwsh</ComboBoxItem>
4445
<ComboBoxItem>RunCommand</ComboBoxItem>
4546
</ComboBox>
4647
<StackPanel Grid.Row="4" Orientation="Horizontal">

Plugins/Flow.Launcher.Plugin.Shell/ShellSetting.xaml.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using System.Collections.Generic;
1+
using System.Collections.Generic;
22
using System.Windows;
33
using System.Windows.Controls;
44

@@ -72,6 +72,7 @@ private void CMDSetting_OnLoaded(object sender, RoutedEventArgs re)
7272
{
7373
Shell.Cmd => 0,
7474
Shell.Powershell => 1,
75+
Shell.Pwsh => 2,
7576
_ => ShellComboBox.Items.Count - 1
7677
};
7778

@@ -81,6 +82,7 @@ private void CMDSetting_OnLoaded(object sender, RoutedEventArgs re)
8182
{
8283
0 => Shell.Cmd,
8384
1 => Shell.Powershell,
85+
2 => Shell.Pwsh,
8486
_ => Shell.RunCommand
8587
};
8688
LeaveShellOpen.IsEnabled = _settings.Shell != Shell.RunCommand;

0 commit comments

Comments
 (0)