Skip to content

Commit 44c5283

Browse files
authored
Merge pull request #2834 from corbob/a1185-fix-hooks
2 parents b7934fd + 3ac2b5f commit 44c5283

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/chocolatey/infrastructure.app/services/PowershellService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,14 +194,14 @@ public string wrap_script_with_module(string script, IEnumerable<string> hookPre
194194

195195
private string get_script_arguments(string script, IEnumerable<string> hookPreScriptPathList, IEnumerable<string> hookPostScriptPathList, ChocolateyConfiguration config)
196196
{
197-
return "-packageScript '{0}' -installArguments '{1}' -packageParameters '{2}'{3}{4}{5}{6}".format_with(
197+
return "-packageScript '{0}' -installArguments '{1}' -packageParameters '{2}'{3}{4} -preRunHookScripts {5} -postRunHookScripts {6}".format_with(
198198
script,
199199
prepare_powershell_arguments(config.InstallArguments),
200200
prepare_powershell_arguments(config.PackageParameters),
201201
config.ForceX86 ? " -forceX86" : string.Empty,
202202
config.OverrideArguments ? " -overrideArgs" : string.Empty,
203-
hookPreScriptPathList.Any() ? " -preRunHookScripts {0}".format_with(string.Join(",", hookPreScriptPathList)) : string.Empty,
204-
hookPostScriptPathList.Any() ? " -postRunHookScripts {0}".format_with(string.Join(",", hookPostScriptPathList)) : string.Empty
203+
hookPreScriptPathList.Any() ? "{0}".format_with(string.Join(",", hookPreScriptPathList)) : "$null",
204+
hookPostScriptPathList.Any() ? "{0}".format_with(string.Join(",", hookPostScriptPathList)) : "$null"
205205
);
206206
}
207207

0 commit comments

Comments
 (0)