diff --git a/src/chocolatey/infrastructure.app/services/PowershellService.cs b/src/chocolatey/infrastructure.app/services/PowershellService.cs index 0faf6952d3..92ee18f603 100644 --- a/src/chocolatey/infrastructure.app/services/PowershellService.cs +++ b/src/chocolatey/infrastructure.app/services/PowershellService.cs @@ -165,7 +165,7 @@ private string get_script_arguments(string script, ChocolateyConfiguration confi private string prepare_powershell_arguments(string argument) { - return argument.to_string().Replace("\"", "\\\""); + return argument.to_string().Replace("\"", "\\\"").Replace("'", "\\'"); } public bool run_action(ChocolateyConfiguration configuration, PackageResult packageResult, CommandNameType command)