diff --git a/src/System.Management.Automation/namespaces/FileSystemProvider.cs b/src/System.Management.Automation/namespaces/FileSystemProvider.cs index c7a69fd540..b1f4abac39 100644 --- a/src/System.Management.Automation/namespaces/FileSystemProvider.cs +++ b/src/System.Management.Automation/namespaces/FileSystemProvider.cs @@ -1331,22 +1331,25 @@ namespace Microsoft.PowerShell.Commands if (ShouldProcess(resource, action)) { - System.Diagnostics.Process invokeProcess = new System.Diagnostics.Process(); - invokeProcess.StartInfo.UseShellExecute = true; - if (Platform.IsWindows) { System.Diagnostics.Process.Start(path); - } else if (Platform.IsOSX) { + } + else if (Platform.IsOSX) { + System.Diagnostics.Process invokeProcess = new System.Diagnostics.Process(); + invokeProcess.StartInfo.UseShellExecute = true; invokeProcess.StartInfo.FileName = "open"; invokeProcess.StartInfo.Arguments = path; - } else if (Platform.IsLinux) { + } + else if (Platform.IsLinux) { + System.Diagnostics.Process invokeProcess = new System.Diagnostics.Process(); + invokeProcess.StartInfo.UseShellExecute = true; invokeProcess.StartInfo.FileName = "xdg-open"; invokeProcess.StartInfo.Arguments = path; } + invokeProcess.Start(); - //System.Diagnostics.Process.Start(path); } } // InvokeDefaultAction