Confirming before installing choco and improving prompt message

This commit is contained in:
Karol Kaczmarek committed 2016-07-25 13:55:34 -07:00
1 parent 536085ea58
commit 05485c7a25
1 file changed
+9 -1
+9 -1
View File
@@ -609,6 +609,8 @@ function Start-PSBootstrap {
elseif(($cmakePresent -eq $false) -or ($sdkPresent -eq $false))
{
log "Chocolatey not present. Installing chocolatey."
if ($Force -or $PSCmdlet.ShouldProcess("Install chocolatey via https://chocolatey.org/install.ps1"))
{
Invoke-Expression ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
if (-not ($machinePath.ToLower().Contains($chocolateyPath.ToLower())))
@@ -623,6 +625,12 @@ function Start-PSBootstrap {
}
}
else
{
Write-Error "Chocolatey is required to install missing dependencies. Please install it from https://chocolatey.org/ manually. Alternatively, install cmake and Windows 10 SDK."
return $null
}
}
else
{
log "Skipping installation of chocolatey, cause both cmake and Win 10 SDK are present."
}
@@ -667,7 +675,7 @@ function Start-PSBootstrap {
if ($newMachineEnvironmentPath -ne $machinePath)
{
log "Updating Path machine environment variable"
if ($Force -or $PSCmdlet.ShouldProcess("Update Path machine environment variable"))
if ($Force -or $PSCmdlet.ShouldProcess("Update Path machine environment variable to $newMachineEnvironmentPath"))
{
[Environment]::SetEnvironmentVariable('Path', $newMachineEnvironmentPath, 'MACHINE')
}