Skip to content

Commit 4785078

Browse files
committed
Only use quote escaping in dot source template
1 parent b737a89 commit 4785078

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/PowerShellEditorServices/Session/PowerShellContext.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ public async Task ExecuteScriptWithArgs(string script, string arguments = null,
796796
if (File.Exists(script) || File.Exists(scriptAbsPath))
797797
{
798798
// Dot-source the launched script path
799-
script = ". " + FullyPowerShellEscapePath(script);
799+
script = ". " + QuoteEscapeString(script);
800800
}
801801

802802
launchedScript = script + " " + arguments;
@@ -1129,15 +1129,15 @@ public async Task SetWorkingDirectory(string path, bool isPathAlreadyEscaped)
11291129
internal static string FullyPowerShellEscapePath(string path)
11301130
{
11311131
string globEscapedPath = GlobEscapePath(path);
1132-
return QuoteEscapePath(globEscapedPath);
1132+
return QuoteEscapeString(globEscapedPath);
11331133
}
11341134

11351135
/// <summary>
1136-
/// Wrap an already escaped path in quotes to make it safe to use in scripts.
1136+
/// Wrap a string in quotes to make it safe to use in scripts.
11371137
/// </summary>
11381138
/// <param name="escapedPath">The glob-escaped path to wrap in quotes.</param>
11391139
/// <returns>The given path wrapped in quotes appropriately.</returns>
1140-
internal static string QuoteEscapePath(string escapedPath)
1140+
internal static string QuoteEscapeString(string escapedPath)
11411141
{
11421142
var sb = new StringBuilder(escapedPath.Length + 2); // Length of string plus two quotes
11431143
sb.Append('\'');

0 commit comments

Comments
 (0)