diff --git a/nuget/chocolatey/tools/chocolateysetup.psm1 b/nuget/chocolatey/tools/chocolateysetup.psm1 index d615b8ffc6..5e3440796a 100644 --- a/nuget/chocolatey/tools/chocolateysetup.psm1 +++ b/nuget/chocolatey/tools/chocolateysetup.psm1 @@ -4,7 +4,7 @@ $sysDrive = $env:SystemDrive $tempDir = $env:TEMP $defaultChocolateyPathOld = "$sysDrive\Chocolatey" #$ErrorActionPreference = 'Stop' -$debugMode = $false +$debugModeParams = "" function Initialize-Chocolatey { <# @@ -34,17 +34,13 @@ param( Write-Debug "Initialize-Chocolatey" if ($env:ChocolateyEnvironmentDebug -eq 'true') { - $debugMode = $true + $debugModeParams = "dv" } Install-DotNet4IfMissing $chocoNew = Join-Path $thisScriptFolder 'chocolateyInstall\choco.exe' - if ($debugMode) { - & $chocoNew unpackself -fdvy - } else { - & $chocoNew unpackself -fy - } + & $chocoNew unpackself -fy$debugModeParams $installModule = Join-Path $thisScriptFolder 'chocolateyInstall\helpers\chocolateyInstaller.psm1' Import-Module $installModule -Force @@ -313,11 +309,7 @@ param( $chocoExeDest = Join-Path $chocolateyPath 'choco.exe' Copy-Item $chocoExe $chocoExeDest -force - if ($debugMode) { - & $chocoExeDest unpackself -fdvy - } else { - & $chocoExeDest unpackself -fy - } + & $chocoExeDest unpackself -fy$debugModeParams } function Ensure-ChocolateyLibFiles {