From e3fd809d42c1ef17c9455f2d3796a56680ca08da Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Fri, 1 Jul 2016 11:14:24 -0700 Subject: [PATCH] Normalize slashes in path given to --file Since we don't yet have a canonical way to normalize paths, here is yet another use of String.Replace (and this is how it happens). --- .../host/msh/CommandLineParameterParser.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs b/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs index ea5b8dfdf..f595080f6 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs +++ b/src/Microsoft.PowerShell.ConsoleHost/host/msh/CommandLineParameterParser.cs @@ -483,7 +483,10 @@ namespace Microsoft.PowerShell string exceptionMessage = null; try { - file = Path.GetFullPath(args[i]); + // Normalize slashes + file = args[i].Replace(StringLiterals.AlternatePathSeparator, + StringLiterals.DefaultPathSeparator); + file = Path.GetFullPath(file); } catch (Exception e) {