diff --git a/src/chocolatey.resources/helpers/chocolateyScriptRunner.ps1 b/src/chocolatey.resources/helpers/chocolateyScriptRunner.ps1 index 0cc03ce2b7..5085d69092 100644 --- a/src/chocolatey.resources/helpers/chocolateyScriptRunner.ps1 +++ b/src/chocolatey.resources/helpers/chocolateyScriptRunner.ps1 @@ -58,5 +58,4 @@ if ($env:ChocolateyExitCode -ne $null -and $env:ChocolateyExitCode -ne '') { $exitCode = $env:ChocolateyExitCode } - Exit $exitCode \ No newline at end of file diff --git a/src/chocolatey/infrastructure/powershell/PoshHost.cs b/src/chocolatey/infrastructure/powershell/PoshHost.cs index 302e1f5cdc..a1f3559548 100644 --- a/src/chocolatey/infrastructure/powershell/PoshHost.cs +++ b/src/chocolatey/infrastructure/powershell/PoshHost.cs @@ -26,6 +26,8 @@ public class PoshHost : PSHost private readonly ChocolateyConfiguration _configuration; private readonly Guid _hostId = Guid.NewGuid(); private readonly PoshHostUserInterface _psUI; + private readonly CultureInfo _cultureInfo = System.Threading.Thread.CurrentThread.CurrentCulture; + private readonly CultureInfo _cultureUiInfo = System.Threading.Thread.CurrentThread.CurrentUICulture; private bool _isClosing; @@ -60,12 +62,12 @@ public override void SetShouldExit(int exitCode) public override CultureInfo CurrentCulture { - get { return CultureInfo.InvariantCulture; } + get { return _cultureInfo; } } public override CultureInfo CurrentUICulture { - get { return CultureInfo.InvariantCulture; } + get { return _cultureUiInfo; } } public override Guid InstanceId