param( [Parameter(Mandatory=$true)] [string]$script, [Parameter(Mandatory=$false, ValueFromRemainingArguments=$true)] [string[]]$scriptArguments ) Set-StrictMode -Version Latest $ErrorActionPreference = 'Stop' trap { Write-Output "ERROR: $_" Write-Output (($_.ScriptStackTrace -split '\r?\n') -replace '^(.*)$','ERROR: $1') Exit 1 } # wrap the choco command (to make sure this script aborts when it fails). function Start-Choco([string[]]$Arguments, [int[]]$SuccessExitCodes=@(0)) { $command, $commandArguments = $Arguments if ($command -eq 'install') { $Arguments = @($command, '--no-progress') + $commandArguments } for ($n = 0; $n -lt 10; ++$n) { if ($n) { # NB sometimes choco fails with "The package was not found with the source(s) listed." # but normally its just really a transient "network" error. Write-Host "Retrying choco install..." Start-Sleep -Seconds 3 } &C:\ProgramData\chocolatey\bin\choco.exe @Arguments if ($SuccessExitCodes -Contains $LASTEXITCODE) { return } } throw "$(@('choco')+$Arguments | ConvertTo-Json -Compress) failed with exit code $LASTEXITCODE" } function choco { Start-Choco $Args } Set-Location c:\vagrant\provision $script = Resolve-Path $script Set-Location (Split-Path -Parent $script) Write-Host "Running $script..." . ".\$(Split-Path -Leaf $script)" @scriptArguments
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#3 | 25623 | Jen Bottom | Have moved the AD stuff in to the 'ldap' directory | ||
#2 | 25621 | Jen Bottom | Integrating sone fixes from dev to main | ||
#1 | 23849 | Jen Bottom |
Integrating an AD setup from dev to main. This is based on a Vagrant setup that is available on GitHub |