Skip to content

Instantly share code, notes, and snippets.

@Iristyle
Last active September 30, 2015 15:58
Show Gist options
  • Save Iristyle/62656792dcb6e7957ef8 to your computer and use it in GitHub Desktop.
Save Iristyle/62656792dcb6e7957ef8 to your computer and use it in GitHub Desktop.
When using puppet_for_the_win, call this instead of setup_env.bat
cd C:\source\puppetwinbuilder
.\setup_env.ps1
$Env:ARCH = 'x64'
cd c:\source\puppet_for_the_win
bundle exec rake clobber
bundle exec rake windows:build config=foss-3.7-x64.yaml
# execute installer
C:\source\puppet_for_the_win>msiexec /i src\puppet_for_the_win\pkg\puppet.msi PUPPET_AGENT_ACCOUNT_DOMAIN=vagrant-2008R2 PUPPET_AGENT_ACOUNT_USER=vagrant PUPPET_AGENT_ACCOUNT_PASSWORD=vagrant /l*v install.log
function Get-Batchfile ($file)
{
$cmd = "`"$file`" & set"
cmd /c $cmd | % {
$p, $v = $_.split('=')
Set-Item -path env:$p -value $v
}
}
function SetupEnv
{
$name = "setup_env"
$readVersion = Get-Variable -Scope Global -Name $name `
-ErrorAction SilentlyContinue
#continually jamming stuff into PATH is *not* cool ;0
if ($readVersion) { return }
Write-Host "Reading env vars..."
Get-Batchfile '.\setup_env.bat'
Set-Variable -Scope Global -Name $name -Value $true
}
function Get-CurrentDirectory
{
$thisName = $MyInvocation.MyCommand.Name
[IO.Path]::GetDirectoryName((Get-Content function:$thisName).File)
}
Set-Location (Get-CurrentDirectory)
SetupEnv
@Iristyle
Copy link
Author

This assumes that:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment