diff --git a/src/System.Management.Automation/namespaces/FileSystemProvider.cs b/src/System.Management.Automation/namespaces/FileSystemProvider.cs index 8f691de069..e10a175945 100644 --- a/src/System.Management.Automation/namespaces/FileSystemProvider.cs +++ b/src/System.Management.Automation/namespaces/FileSystemProvider.cs @@ -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; /// - /// 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. /// [Parameter]