Skip to content

Commit

Permalink
Merge branch 'pr129'
Browse files Browse the repository at this point in the history
* pr129:
  (chocolatey-archiveGH-128) PowerShell 1.x provider fixes for "else"
  • Loading branch information
ferventcoder committed Jun 20, 2016
2 parents 84786e2 + 75d7df6 commit 7af3253
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions templates/InstallChocolatey.ps1.erb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ $chocErrorLog = Join-Path $tempDir "chocError.log"
# to the FileStream not being what is expected. Fixes "The OS handle's
# position is not what FileStream expected. Do not use a handle
# simultaneously in one FileStream and in Win32 code or another
# FileStream."
# FileStream."


# This only works with the ConsoleHost (PowerShell InternalHost)
function Fix-PowerShellOutputRedirectionBug {
Expand All @@ -55,7 +56,8 @@ function Fix-PowerShellOutputRedirectionBug {
$field2.SetValue($consoleHost, [Console]::Error)
} catch {
Write-Output "Unable to apply redirection fix. Error: $_"
}
}


}

Expand Down Expand Up @@ -99,8 +101,7 @@ $chocInstallPS1 = Join-Path $toolsFolder "chocolateyInstall.ps1"

if ($PSVersionTable.psversion.Major -gt 2) {
& $chocInstallPS1
}
else {
} else {
$output = Invoke-Expression $chocInstallPS1
$output
write-output "Any errors that occured during install or upgrade are logged here: $chocoErrorLog"
Expand Down

0 comments on commit 7af3253

Please sign in to comment.