Created
May 15, 2018 07:58
-
-
Save mwallner/06a38bab51bb4cc7b40edb9b92a4c446 to your computer and use it in GitHub Desktop.
install a chocolatey package with boxstarter using chocolatey sources
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
$pkg | |
) | |
$chococfg = "C:\ProgramData\chocolatey\config\chocolatey.config" | |
if (-Not $(Test-Path $chococfg)) { | |
throw "choco config not found!" | |
} | |
[xml]$cfg = Get-Content $chococfg | |
$nugetSources = "" | |
$cfg.chocolatey.sources.source | Foreach-Object { | |
if ($_.disabled -eq $false) { | |
$nugetSources += "$($_.Value);" | |
} | |
} | |
Write-Output "using sources: '$nugetSources'" | |
Set-BoxstarterConfig -NugetSources $nugetSources | |
$Boxstarter.RebootOk=$true | |
$Boxstarter.NoPassword=$false | |
$Boxstarter.AutoLogin=$true | |
$user=[System.Environment]::UserName | |
$domain=[System.Environment]::UserDomainName | |
$_cred=Get-Credential "$domain\$user" | |
Install-BoxstarterPackage $pkg -Credential $_cred |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment