diff --git a/src/chocolatey.resources/helpers/functions/Format-FileSize.ps1 b/src/chocolatey.resources/helpers/functions/Format-FileSize.ps1 index 1006c342d1..acda6aedea 100644 --- a/src/chocolatey.resources/helpers/functions/Format-FileSize.ps1 +++ b/src/chocolatey.resources/helpers/functions/Format-FileSize.ps1 @@ -49,8 +49,8 @@ param ( [Parameter(Mandatory=$true, Position=0)][double] $size, [parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments ) - # This interrupts download progress, so ensure there is no output. - #Write-Debug "Running 'Format-FileSize' with size: '$size'"; + + # Do not log function call, it interrupts the single line download progress output. Foreach ($unit in @('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB')) { If ($size -lt 1024) { diff --git a/src/chocolatey.resources/helpers/functions/Set-PowerShellExitCode.ps1 b/src/chocolatey.resources/helpers/functions/Set-PowerShellExitCode.ps1 index a730e29038..9ec3324983 100644 --- a/src/chocolatey.resources/helpers/functions/Set-PowerShellExitCode.ps1 +++ b/src/chocolatey.resources/helpers/functions/Set-PowerShellExitCode.ps1 @@ -45,16 +45,18 @@ param ( [parameter(ValueFromRemainingArguments = $true)][Object[]] $ignoredArguments ) + # Do not log function call - can mess things up + if ($exitCode -eq $null -or $exitCode -eq '') { Write-Debug '$exitCode was passed null' return } try { - $host.SetShouldExit($exitCode); + $host.SetShouldExit($exitCode); } catch { Write-Warning "Unable to set host exit code" } - + $env:ChocolateyExitCode = $exitCode; }