mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 12:45:47 +00:00
Adding logic for invoke-item for non-Windows OSes
This commit is contained in:
1 parent
07501f1d3a
commit
eec3b334cc
1 file changed
+17
-2
@@ -1331,7 +1331,22 @@ namespace Microsoft.PowerShell.Commands
|
||||
|
||||
if (ShouldProcess(resource, action))
|
||||
{
|
||||
System.Diagnostics.Process.Start(path);
|
||||
System.Diagnostics.Process invokeProcess = new System.Diagnostics.Process();
|
||||
invokeProcess.StartInfo.UseShellExecute = true;
|
||||
|
||||
if (Platform.IsWindows)
|
||||
{
|
||||
System.Diagnostics.Process.Start(path);
|
||||
} else if (Platform.IsOSX) {
|
||||
invokeProcess.StartInfo.FileName = "open";
|
||||
invokeProcess.StartInfo.Arguments = path;
|
||||
} else if (Platform.IsLinux) {
|
||||
invokeProcess.StartInfo.FileName = "xdg-open";
|
||||
invokeProcess.StartInfo.Arguments = path;
|
||||
}
|
||||
invokeProcess.Start();
|
||||
|
||||
//System.Diagnostics.Process.Start(path);
|
||||
}
|
||||
} // InvokeDefaultAction
|
||||
|
||||
@@ -7784,7 +7799,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
private bool wait;
|
||||
|
||||
/// <summary>
|
||||
/// When the –Raw switch is present, we don’t do any breaks on newlines,
|
||||
/// When the �Raw switch is present, we don�t do any breaks on newlines,
|
||||
/// and only emit one object to the pipeline: all of the content.
|
||||
/// </summary>
|
||||
[Parameter]
|
||||
|
||||
Reference in new issue
Block a user