Skip to content

Commit e39da4f

Browse files
committed
Properly quoting the rest of the script file paths in ScriptFunctionInvoker
1 parent e86cc0b commit e39da4f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/WebJobs.Script/Description/ScriptFunctionInvoker.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,24 +64,24 @@ public override async Task Invoke(object[] parameters)
6464
switch (_scriptType)
6565
{
6666
case "ps1":
67-
scriptHostArguments = string.Format("-ExecutionPolicy RemoteSigned -File {0}", _scriptFilePath);
67+
scriptHostArguments = string.Format("-ExecutionPolicy RemoteSigned -File \"{0}\"", _scriptFilePath);
6868
await ExecuteScriptAsync("PowerShell.exe", scriptHostArguments, parameters);
6969
break;
7070
case "cmd":
7171
case "bat":
72-
scriptHostArguments = string.Format("/c {0}", _scriptFilePath);
72+
scriptHostArguments = string.Format("/c \"{0}\"", _scriptFilePath);
7373
await ExecuteScriptAsync("cmd", scriptHostArguments, parameters);
7474
break;
7575
case "py":
76-
scriptHostArguments = string.Format("{0}", _scriptFilePath);
76+
scriptHostArguments = string.Format("\"{0}\"", _scriptFilePath);
7777
await ExecuteScriptAsync("python.exe", scriptHostArguments, parameters);
7878
break;
7979
case "php":
80-
scriptHostArguments = string.Format("{0}", _scriptFilePath);
80+
scriptHostArguments = string.Format("\"{0}\"", _scriptFilePath);
8181
await ExecuteScriptAsync("php.exe", scriptHostArguments, parameters);
8282
break;
8383
case "sh":
84-
scriptHostArguments = string.Format("{0}", _scriptFilePath);
84+
scriptHostArguments = string.Format("\"{0}\"", _scriptFilePath);
8585
string bashPath = ResolveBashPath();
8686
await ExecuteScriptAsync(bashPath, scriptHostArguments, parameters);
8787
break;

0 commit comments

Comments
 (0)