Skip to content

Commit

Permalink
(chocolatey#1489) Log PowerShell contents w/out formatting
Browse files Browse the repository at this point in the history
If logging the contents of the PowerShell script go through formatting,
there is a good chance that the formatter will mess it up somewhere.
This is due to the use of `{` and `}` in PowerShell. Ensure it is not
sent through formatting.
  • Loading branch information
ferventcoder committed Feb 12, 2018
1 parent 31d0fc9 commit dbc0a3b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ public bool run_action(ChocolateyConfiguration configuration, PackageResult pack

this.Log().Debug(ChocolateyLoggers.Important, "Contents of '{0}':".format_with(chocoPowerShellScript));
string chocoPowerShellScriptContents = _fileSystem.read_file(chocoPowerShellScript);
this.Log().Debug(chocoPowerShellScriptContents.escape_curly_braces());
// leave this way, doesn't take it through formatting.
this.Log().Debug(() => chocoPowerShellScriptContents.escape_curly_braces());

bool shouldRun = !configuration.PromptForConfirmation;

Expand Down

0 comments on commit dbc0a3b

Please sign in to comment.