Downloads:

20,511

Downloads of v 2.4.123:

415

Last Update:

24 Sep 2014

Package Maintainer(s):

Software Author(s):

  • Matt Wrock

Tags:

Boxstarter testing environment setup

Boxstarter Test Runner Module

This is not the latest version of Boxstarter Test Runner Module available.

2.4.123 | Updated: 24 Sep 2014

Downloads:

20,511

Downloads of v 2.4.123:

415

Software Author(s):

  • Matt Wrock

Boxstarter Test Runner Module 2.4.123

This is not the latest version of Boxstarter Test Runner Module available.

All Checks are Unknown

2 Test of Unknown Status


Validation Testing Unknown


Verification Testing Unknown

To install Boxstarter Test Runner Module, run the following command from the command line or from PowerShell:

>

To upgrade Boxstarter Test Runner Module, run the following command from the command line or from PowerShell:

>

To uninstall Boxstarter Test Runner Module, run the following command from the command line or from PowerShell:

>

NOTE: This applies to both open source and commercial editions of Chocolatey.

1. Ensure you are set for organizational deployment

Please see the organizational deployment guide

  • Open Source or Commercial:
    • Proxy Repository - Create a proxy nuget repository on Nexus, Artifactory Pro, or a proxy Chocolatey repository on ProGet. Point your upstream to https://chocolatey.org/api/v2. Packages cache on first access automatically. Make sure your choco clients are using your proxy repository as a source and NOT the default community repository. See source command for more information.
    • You can also just download the package and push it to a repository Download

3. Enter your internal repository url

(this should look similar to https://chocolatey.org/api/v2)

4. Choose your deployment method:


choco upgrade boxstarter.testrunner -y --source="'STEP 3 URL'" [other options]

See options you can pass to upgrade.

See best practices for scripting.

Add this to a PowerShell script or use a Batch script with tools and in places where you are calling directly to Chocolatey. If you are integrating, keep in mind enhanced exit codes.

If you do use a PowerShell script, use the following to ensure bad exit codes are shown as failures:


choco upgrade boxstarter.testrunner -y --source="'STEP 3 URL'" 
$exitCode = $LASTEXITCODE

Write-Verbose "Exit code was $exitCode"
$validExitCodes = @(0, 1605, 1614, 1641, 3010)
if ($validExitCodes -contains $exitCode) {
  Exit 0
}

Exit $exitCode

- name: Ensure boxstarter.testrunner installed
  win_chocolatey:
    name: boxstarter.testrunner
    state: present
    version: 2.4.123
    source: STEP 3 URL

See docs at https://docs.ansible.com/ansible/latest/modules/win_chocolatey_module.html.

Coming early 2020! Central Managment Reporting available now! More information...


chocolatey_package 'boxstarter.testrunner' do
  action    :install
  version  '2.4.123'
  source   'STEP 3 URL'
end

See docs at https://docs.chef.io/resource_chocolatey_package.html.


Chocolatey::Ensure-Package
(
    Name: boxstarter.testrunner,
    Version: 2.4.123,
    Source: STEP 3 URL
);

Requires Otter Chocolatey Extension. See docs at https://inedo.com/den/otter/chocolatey.


cChocoPackageInstaller boxstarter.testrunner
{
   Name     = 'boxstarter.testrunner'
   Ensure   = 'Present'
   Version  = '2.4.123'
   Source   = 'STEP 3 URL'
}

Requires cChoco DSC Resource. See docs at https://github.com/chocolatey/cChoco.


package { 'boxstarter.testrunner':
  provider => 'chocolatey',
  ensure   => '2.4.123',
  source   => 'STEP 3 URL',
}

Requires Puppet Chocolatey Provider module. See docs at https://forge.puppet.com/puppetlabs/chocolatey.


salt '*' chocolatey.install boxstarter.testrunner version="2.4.123" source="STEP 3 URL"

See docs at https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.chocolatey.html.

5. If applicable - Chocolatey configuration/installation

See infrastructure management matrix for Chocolatey configuration elements and examples.

This package was approved by moderator ferventcoder on 26 Oct 2014.

Description

Boxstarter's Test Runner module makes it easy to automate the testing and publishing of Chocolatey packages.


tools\Boxstarter.TestRunner\Bootstrap.ps1
function Bootstrap-Boxstarter {
    if(-not $env:ChocolateyInstall -or -not (Test-Path "$env:ChocolateyInstall")){
        Write-Output "Chocolatey not installed. Downloading and installing..."
        $env:ChocolateyInstall = "$env:programdata\chocolatey"
        New-Item $env:ChocolateyInstall -Force -type directory | Out-Null
        Get-HttpToFile "http://chocolatey.org/install.ps1" "$env:temp\choco.ps1"
        . "$env:temp\choco.ps1"
    }

    if(!(Get-Module -ListAvailable -Name boxstarter.testrunner -ErrorAction SilentlyContinue)) { 
            Write-Output "Boxstarter TestRunner not installed. Installing..."
            if($debug.length -gt 0) {
                ."$env:ChocolateyInstall\chocolateyinstall\chocolatey.ps1" Install Boxstarter.TestRunner -source "$PSScriptRoot" 
            }
            ."$env:ChocolateyInstall\chocolateyinstall\chocolatey.ps1" Install Boxstarter.TestRunner
    }

    if(!(Get-Module Boxstarter.Azure)){
        Import-Module $env:AppData\Boxstarter\Boxstarter.Azure\Boxstarter.Azure.psd1
    }
    if(!(Get-Module Boxstarter.TestRunner)){
        Import-Module $env:AppData\Boxstarter\Boxstarter.TestRunner\Boxstarter.TestRunner.psd1
    }
}

function Get-HttpToFile ($url, $file){
    Write-Output "Downloading $url to $file"
    Invoke-RetriableScript -RetryScript {
        if(Test-Path $args[1]){Remove-Item $args[1] -Force}
        $downloader=new-object net.webclient
        $wp=[system.net.WebProxy]::GetDefaultProxy()
        $wp.UseDefaultCredentials=$true
        $downloader.Proxy=$wp
        try {
            $downloader.DownloadFile($args[0], $args[1])
        }
        catch{
            Write-Error $($_.Exception | fl * -Force | Out-String)
            throw $_
        }
    } $url $file
}

function Invoke-RetriableScript{
<#
.SYNOPSIS
Retries a script 5 times or until it completes without terminating errors. 
All Unnamed arguments will be passed as arguments to the script
#>
    param([ScriptBlock]$RetryScript)
    $currentErrorAction=$ErrorActionPreference
    try{
        $ErrorActionPreference = "Stop"
        for($count = 1; $count -le 5; $count++) {
            try {
                Write-Verbose "Attempt #$count..."
                $ret = Invoke-Command -ScriptBlock $RetryScript -ArgumentList $args
                return $ret
                break
            }
            catch {
                if($global:Error.Count -gt 0){$global:Error.RemoveAt(0)}
                if($count -eq 5) { throw $_ }
                else { Sleep 10 }
            }
        }
    }
    finally{
        $ErrorActionPreference = $currentErrorAction
    }
}


function Set-BoxstarterAzureOptions {
    param(
        [string]$AzureSubscriptionName,
        [string]$AzureSubscriptionId,
        [string]$AzureSubscriptionCertificate
    )
    Write-Output "setting Azure Subscription Details"
    $encodedCert = [System.Convert]::FromBase64String($AzureSubscriptionCertificate)
    $CertToImport = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2 $encodedCert,""
    $store = New-Object System.Security.Cryptography.X509Certificates.X509Store "My", "CurrentUser"
    $store.Certificates.Count
    $store.Open([System.Security.Cryptography.X509Certificates.OpenFlags]::ReadWrite)
    $store.Add($CertToImport)
    $store.Close()
    Set-AzureSubscription -SubscriptionName $AzureSubscriptionName -SubscriptionId $AzureSubscriptionId -Certificate $CertToImport
    Select-AzureSubscription -SubscriptionName $AzureSubscriptionName -Default
}

Bootstrap-Boxstarter
tools\Boxstarter.TestRunner\Boxstarter.proj
 
tools\Boxstarter.TestRunner\Boxstarter.TestRunner.psd1
 
tools\Boxstarter.TestRunner\Boxstarter.TestRunner.psm1
$unNormalized=(Get-Item "$PSScriptRoot\..\Boxstarter.Chocolatey\Boxstarter.Chocolatey.psd1")
Import-Module $unNormalized.FullName -global -DisableNameChecking -Force
$unNormalized=(Get-Item "$PSScriptRoot\..\Boxstarter.Azure\Boxstarter.Azure.psd1")
Import-Module $unNormalized.FullName -global -DisableNameChecking -Force -ErrorAction SilentlyContinue

Resolve-Path $PSScriptRoot\*-*.ps1 | 
    % { . $_.ProviderPath }

Export-ModuleMember Get-BoxstarterDeployOptions, Set-BoxstarterDeployOptions, Test-BoxstarterPackage, Install-BoxstarterScripts, Get-BoxstarterPackage, Get-BoxstarterPackageNugetFeed, Set-BoxstarterPackageNugetFeed, Remove-BoxstarterPackageNugetFeed, Publish-BoxstarterPackages, Set-BoxstarterFeedAPIKey, Publish-BoxstarterPackage, Select-BoxstarterResultsToPublish, Get-BoxstarterFeedAPIKey
tools\Boxstarter.TestRunner\Boxstarter.TestRunner.pssproj
 
tools\Boxstarter.TestRunner\BoxstarterBuild.ps1
param(
    $PublishSuccesfulPackages,
    $DeploymentTargetUserName,
    $DeploymentTargetPassword,
    $FeedAPIKey,
    $AzureSubscriptionName,
    $AzureSubscriptionId,
    $AzureSubscriptionCertificate,
    $debug
)
$here = Split-Path -Parent $MyInvocation.MyCommand.Path

#Download everything we need and import modules
. .\Bootstrap.ps1

#Configure our settings
$Boxstarter.LocalRepo=(Resolve-Path "$here\..\")
if($DeploymentTargetUserName.length -gt 0) {
    Set-BoxstarterDeployOptions -DeploymentTargetUserName $DeploymentTargetUserName -DeploymentTargetPassword $DeploymentTargetPassword
}
if($FeedAPIKey.length -gt 0) {
    Set-BoxstarterDeployOptions -DefaultFeedAPIKey $FeedAPIKey
}

if($AzureSubscriptionName.length -gt 0) {
    Set-BoxstarterAzureOptions $AzureSubscriptionName $AzureSubscriptionId $AzureSubscriptionCertificate
}

#We want to exit with an unsuccessful exit code if any tests fail or not tests are run at all
$failedTests=0
$failedPubs=0
$testedPackage = @()
Test-BoxstarterPackage -Verbose | % {
    if($_.Package){
        $testedPackage += $_
        if($_.Status -eq "failed"){
            $failedTests++
        }
    }
    $_
}

if($PublishSuccesfulPackages.length -gt 0){
    $testedPackage | Select-BoxstarterResultsToPublish | Publish-BoxstarterPackage | % {
        if($_.PublishErrors -ne $null) { $failedPubs++ }
        $_
    }
}

if ($testedPackage.Count -eq 0) {
    throw "no tests performed. That cant be right."
}
Exit $failedTests + $failedPubs
tools\Boxstarter.TestRunner\en-US\about_Boxstarter_TestRunner.help.txt
TOPIC
	About_Boxstarter_TestRunner

SYNOPSIS
	Describes how to use the Boxstarter TestRunner module to test 
    chocolatey package installs and publish packages that pass tests.

DESCRIPTION
	The Boxstarter TestRunner module can test chocolatey package installs 
    on one or more deployment targets and evaluate whether the installation 
    was successful. The TestRunner module can also be used to automate 
    the publishing of Chocolatey packages to a Nuget feed. That may be 
    the public chocolatey feed or a private feed.

Configuring the Local Boxstarter Repository
	Boxstarter needs to know where your repository of chocolatey packages 
    is located. The Boxstarter repository is a single directory on disk 
    that contains one subdirectory per package. By default, Boxstarter 
    maintains this directory in a directory called BuildPackages inside 
    the same root directory where the Boxstarter modules reside. All 
    Boxstarter commands that create and build packages act within this 
    directory. The repository location can be found using the $Boxstarter 
    settings variable in $Boxstarter.LocalRepo.

    This location can be changed using the Set-BoxstarterConfig command
    and its -LocalRepo parameter. By changing the location of the 
    Boxstarter repository with Set-BoxstarterConfig all future 
    interactions with the Boxstarter repository will act on this location. 
    
    To temporarily change the repository location just for the current 
    PowerShell session, one can change the value of $Boxstarter.LocalRepo 
    directly.

Configuring Boxstarter Testing Options
    Boxstarter tests Chocolatey packages by deploying and installing the 
    package to one or more deployment targets. The deployment options include 
    settings that control what computers to use to test the packages, the 
    credentials to use, VM checkpoints to restore as well as nuget feed and 
    API key for publishing successful packages. 
    
    To read the current settings for these options, use 
    Get-BoxstarterDeploymentOptions. To set these options use 
    Set-BoxstarterDeploymentOptions. This command can configure the physical
    or virtual machines used to test packages, the credential used to initiate
    connections to these targets. If targeting VMs, one may use one of the 
    Boxstarter VM providers, currently HyperV and Azure. Using these providers
    VM checkpoints can be specified so that before each test installation, the
    VM is restored to this checkpoint. If using a new VM with no checkpoints, 
    the Checkpoints will be created on the first run and then restored on 
    subsequent runs.

    In addition to configuring settings regarding the deployment targets where
    packages will be tested, a default nuget feed URL and an API Key can be
    configured. When testing an entire repository, calling Test-BoxstarterPackage
    with no parameters, the nuget feed is queried for the latest published 
    version. If the local package version is greater than the version published,
    the package install is tested. Individual packages in a Boxstarter repository 
    can be published to different feeds. The nuget feed and API Key configured
    using Set-BoxstarterDeploymentOptions are default settings used if a package 
    has not been individually assigned to its own feed.

    To assign a package to an individual feed, use Set-BoxstarterPackageNugetFeed.
    When using multiple feeds, if one needs to use the Publish-BoxstarterPackage
    command to publish the package to its feed, an API key for each feed must be 
    set. This can be accomplished by using the Set-BoxstarterFeedAPIKey.

Testing Chocolatey Packages
    Test-BoxstarterPackage can be called with an array of packages. 
    Boxstarter will build their .nupkg files and attempt to install 
    them on the deployment targets specified with 
    Set-BoxstarterDeploymentOptions. Boxstarter will use the credentials 
    provided in the deployment options. You can provide several targets to 
    Set-BoxstarterDeploymentOptions. One may wish to supply different 
    machines running different versions of windows. If a package install runs 
    to completion with no exceptions or returned error codes, Boxstarter 
    considers the install a PASSED test. If Test-BoxstarterPackage is called 
    with no packages specified, Boxstarter will iterate over each package in 
    its local repository. It will build the nupkg and compare its version to 
    the version on the package published feed. If the version in the repo 
    is greater than the published version, Boxstarter will initiate a test on 
    the deployment targets otherwise the package test will be skipped.

Publishing Successful Packages
    Test-BoxstarterPackage will return a set of test results. One can then use
    Select-BoxstarterResultsToPublish to consume these results and return the 
    package IDs of the packages who had all deployment targets pass the package 
    install. These IDs can then be passed to Publish-BoxstarterPackage to 
    publish those packages to their associated feeds.

Conserving Cloud Resources
    If the Azure Boxstarter module is used as a VM provider and any of the Azure 
    VMs are not running when the tests begin, Boxstarter will shut down each VM
    that was not initially running once the testing is completed.

Including Testing and Publishing in Continuous Integration
    The Boxstarter TestRunner can be plugged into modern Build systems and
    respond to source control commits. The Boxstarter local repo can be
    setup under a source control system like GIT, Mercurial, TFS, SVN etc.
    Build servers like TeamCity, TFS, Jenkins and others can be configured 
    to listen for changes to the Boxstarter repo. For instance, if the 
    repository is under git source control and pushed to a remote server 
    monitored by a build server, the build server can execute the Boxstarter 
    TestRunner commands to test the packages that have been changed and
    publish them to their feeds if the tests pass.

    The TestRunner module includes an Install-BoxstarterScripts command that 
    embeds a MSBuild file, a bootstrapper and a PowerShell script into a 
    repository that can run the tests and publish successful packages.

    There are two primary usage patterns for running tests from a build server:

    Dedicated Build Server
        Here, tests are run in a build environment on a server that is under 
        your direct ownership and full control. The key differentiator here is 
        that you can set your deployment options on this machine and be 
        confident that they will remain on every build from build to build.

    Hosted or Shared Build Server
        This is often a build server that you do not own or control outside of 
        your individual builds. If you set your deployment options on the server, 
        they may likely be gone on your next build. The Visual Studio Online 
        build services would land in this category.

Configuring a Dedicated Build Server
    If you administer your own build server, there is some one time setup that 
    you need to perform to integrate Boxstarter TestRunner tests and 
    automatic package publishing. This must be performed on the build machine 
    that will run the builds (a remote powershell session is acceptable). In 
    many build systems, this may be a different machine from the central server, 
    in TFS it would be the build "controller" or in TeamCity the build "agent." 
    Also, these steps must be performed using the credentials of the SAME USER 
    ACCOUNT that your build server runs under.

    1. Install the Boxstarter TestRunner module on the build machine. You can 
       use Chocolatey and run cinst Boxstarter.TestRunner or launch 
       http://boxstarter.org/package/nr/boxstarter.testrunner from IE.
    2. Although many of the deployment options are stored in a file inside the 
       repository and will be available when your build server gets the latest 
       repository code, the "secret" options are not kept in source control to 
       prevent this information from being publicly disclosed. These secrets 
       include the deployment target credentials and feed API keys. So you 
       can use Set-BoxstarterDeployOptions and Set-BoxstarterFeedAPIKey to set
       these secrets. The Credential passwords are encrypted and can only be
       unencrypted on the same build server by the same user account setting
       the options. You may also add these settings as msbuild parameters in 
       step 4 described below.
    3. If you will be performing the package test installations on Azure VMs, 
       you will need to configure your Azure subscription. Run 
         Get-AzurePublishSettingsFile 
       to download your subscription file from Azure and then 
         Import-AzurePublishSettingsFile -PublishSettingsFile `
           C:\saved\subscription\file.publishsettings.
       You may also add the Azure management key as a MSBuild parameter 
       described next.
    4. Configure the build configuration of your build server to call the 
       Boxstarter.proj MSBuild file as a step in your build. This file is 
       located in the BoxstarterScripts directory of your repo which 
       Boxstarter creates when you run Install-BoxstarterScripts. This script 
       will invoke a bootstrapper which will install everything needed for 
       the TestRunner to run including the TestRunner itself if not present. 
       On dedicated build servers, where the TestRunner is preinstalled, the 
       bootstrapper will be skipped.
       The script can take the following parameters:
         PublishSuccesfulPackages - Set this to true if you would like successful 
           packages published.
        DeploymentTargetUserName - Username to use when initiating connections 
          to the deployment targets.
        DeploymentTargetPassword - Password to use when initiating connections 
          to the deployment targets.
        FeedAPIKey - API key to use when publishing packages.
        AzureSubscriptionName - Name of the azure subscription to use when 
          using Azure VMs as deployment targets.
        AzureSubscriptionId - The Azure subscription ID Guid to use when 
          using Azure VMs as deployment targets.
        AzureSubscriptionCertificate - The Azure subscription certificate to use 
          when using Azure VMs as deployment targets. This is the Base64 encoded 
          content of the certificate and can be found in the 
          ManagementCertificate attribute of your Azure publish settings file.

        NOTE: All of these MSBuild script parameters are optional for dedicated 
        builds as long as the values were provided in steps 2 and 3 above which 
        may be preferable over having plain text parameter values fed to your 
        build.

Configuring a Hosted or Shared Build Server
    If your build server environment is shared and may be built from scratch 
    on every build then you cannot preinstall the TestRunner and configure 
    necessary settings up front. Instead the runner must be installed during 
    the build process and the settings passed via MSBuild parameters. When 
    you run Install-BoxstarterScripts on your Chocolatey repository, a 
    bootstrapper is added to your repo that can take care of installing the 
    Test Runner and its dependencies. Additionally, you can pass the following 
    MSBuild parameters to the BoxstarterBuild.proj script.

    PublishSuccesfulPackages - Set this to true if you would like successful 
        packages published.
    DeploymentTargetUserName - Username to use when initiating connections 
        to the deployment targets.
    DeploymentTargetPassword - Password to use when initiating connections 
        to the deployment targets.
    FeedAPIKey - API key to use when publishing packages.
    AzureSubscriptionName - Name of the azure subscription to use when 
        using Azure VMs as deployment targets.
    AzureSubscriptionId - The Azure subscription ID Guid to use when 
        using Azure VMs as deployment targets.
    AzureSubscriptionCertificate - The Azure subscription certificate to use 
        when using Azure VMs as deployment targets. This is the Base64 encoded 
        content of the certificate and can be found in the 
        ManagementCertificate attribute of your Azure publish settings file.

SEE ALSO

	http://boxstarter.org
	Set-BoxstarterConfig
    Test-BoxstarterPackage
    Publish-BoxstarterPackage
    Select-BoxstarterResultsToPublish
    Set-BoxstarterPackageNugetFeed
    Set-BoxstarterFeedAPIKey
    Install-BoxstarterScripts
    Set-BoxstarterDeploymentOptions
    Get-BoxstarterDeploymentOptions
tools\Boxstarter.TestRunner\Get-BoxstarterDeployOptions.ps1
function Get-BoxstarterDeployOptions {
<#
.SYNOPSIS
Lists all Boxstarter deployment options currently set 

.DESCRIPTION
Boxstarter tests Chocolatey packages by deploying and installing the 
package to a remote machine. The deployment options include settings 
that control what computers to use to test the packages, the credentials 
to use, VM checkpoints to snap as well as nuget feed and API key for 
publishing successful packages. To change these options, use 
Set-BoxstarterDeploymentOptions.

.LINK
http://boxstarter.org
Set-BoxstarterDeployOptions
#>
    $path = Get-OptionsPath
    $secretPath = Get-SecretOptionsPath
    $fallbackSecretPath = "$($Boxstarter.BaseDir)\BuildPackages\BoxstarterScripts\$env:ComputerName-$env:username-Options.xml"
    if(!(Test-Path $path)) { 
        $options = @{
            DeploymentTargetNames="localhost"
            DeploymentTargetCredentials=$null
            DeploymentVMProvider=$null
            DeploymentCloudServiceName=$null
            RestoreCheckpoint=$null
            DefaultNugetFeed=[Uri]"http://chocolatey.org/api/v2"
            DefaultFeedAPIKey=$null
        }
    }
    else {
        $options = Import-CliXML $path
    }

    if(Test-Path $secretPath) { 
        $options.DeploymentTargetCredentials = Import-CliXML $secretPath
    }
    elseif(Test-Path $fallbackSecretPath) {
        Write-BoxstarterMessage "Falling back to default local repo for secrets" -Verbose
        $options.DeploymentTargetCredentials = Import-CliXML $fallbackSecretPath
    }

    $options.DefaultFeedAPIKey = Get-BoxstarterFeedAPIKey -NugetFeed $options.DefaultNugetFeed

    return $options
}
tools\Boxstarter.TestRunner\Get-BoxstarterFeedAPIKey.ps1
function Get-BoxstarterFeedAPIKey {
<#
.SYNOPSIS
Gets the API key for the specified Nuget feed

.DESCRIPTION
Boxstarter can automatically publish a successfully tested Chocolatey 
package to its associated feed. In order for this to work, Boxstarter 
must have a valid API key authorized to publish to the feed. 
Get-BoxstarterFeedAPIKey retrieves an individual API key associated 
with a given nuget feed URL. Use Set-BoxstarterFeedAPIKey to specify 
a key to be associated with a feed.

.PARAMETER NugetFeed
The URI of a Nuget feed for which the API key is being queried.

.Example
Get-BoxstarterFeedAPIKey "http://chocolatey.org/api/v2"

Retrieves the API Key used with the public Chocolatey feed

.LINK
http://boxstarter.org
Set-BoxstarterFeedAPIKey
#>
    [CmdletBinding()]
    param (
        [URI]$NugetFeed
    )

    $path=Get-FeedsAPIKeyPath
    $fallbackPath = "$($Boxstarter.BaseDir)\BuildPackages\BoxstarterScripts\FeedAPIKeys.xml"

    if(Test-Path $path) {
        $keys = Import-CliXML $path
    }
    elseif(Test-Path $fallbackPath) {
        $keys = Import-CliXML $fallbackPath
    }
    else {
        $keys =  @{}
    }

    if($NugetFeed -and $keys.ContainsKey($NugetFeed)) {
        return $keys.$NugetFeed
    }
}
tools\Boxstarter.TestRunner\Get-BoxstarterPackage.ps1
function Get-BoxstarterPackage {
<#
.SYNOPSIS
Retrieves metadata for all packages in the Local Boxstarter repository 
or an individual package.

.DESCRIPTION
Get-BoxstarterPackage retrieves information about either a single package 
or all packages in the Local Boxstarter repository if no PackageName 
parameter is provided. This information includes package ID, version, the 
latest version published to the packages Nuget feed and the feed URI.

.PARAMETER PackageName
The name of a Chocolatey package in the local repository for which to 
retrieve metadata. If this parameter is not provided then information for 
all packages is provided.

.Example
Get-BoxstarterPackage MyPackageName

Retrieves package metadata for MyPackageName

.Example
Get-BoxstarterPackage

Retrieves package metadata for all packages in the Boxstarter Local repository


.LINK
http://boxstarter.org
#>
    [CmdletBinding()]
    param(
        [string[]]$PackageName
    )

    pushd $Boxstarter.LocalRepo
    try {
        Get-ChildItem . | ? { Test-Path (join-path $_.name "$($_.name).nuspec") } | ? {
            !$PackageName  -or $packagename -contains $_.name
        } | % {
            $nuspecPath=join-path $_.name "$($_.name).nuspec"
            [xml]$nuspec = Get-Content $nuspecPath 
            $feed = Get-BoxstarterPackageNugetFeed -PackageName $_
            $publishedVersion = Get-BoxstarterPackagePublishedVersion $nuspec.package.metadata.id $feed
            New-Object PSObject -Property @{
                Id = $nuspec.package.metadata.id
                Version = $nuspec.package.metadata.version
                PublishedVersion=$publishedVersion
                Feed=$feed
            }
        }
    }
    finally {
        popd
    }    
}
tools\Boxstarter.TestRunner\Get-BoxstarterPackageNugetFeed.ps1
function Get-BoxstarterPackageNugetFeed {
<#
.SYNOPSIS
Gets the Nuget feed associated with an individual package.

.DESCRIPTION
A Chocolatey package repository may publish different packages to 
different feeds. Get-BoxstarterPackageNugetFeed retrieves the Nuget 
feed associated with a specified package name. 
Set-BoxstarterPackageNugetFeed can be used to specify a feed to be 
associated with a package. One may also use Set-BoxstarterDeployOptions 
and use the DefaultNugetFeed parameter to specify which feed to use for 
a package if no feed is specified. If you do not want any feed to be 
associated with a package, explicitly use Set-BoxstarterPackageNugetFeed 
to set the feed of a package to $null.

.PARAMETER PackageName
The name of a Chocolatey package in the local repository for which a 
feed should be retrieved.

.Example
Get-BoxstarterPackageNugetFeed MyPackageName

Retrieves the Nuget feed associated with MyPackageName

.LINK
http://boxstarter.org
Set-BoxstarterPackageNugetFeed
Remove-BoxstarterPackageNugetFeed
Set-BoxstarterDeployOptions
Get-BoxstarterDeployOptions
#>
    [CmdletBinding()]
    param (
        [string]$PackageName
    )

    $path=Get-PackageFeedsPath
    if(!(Test-Path $path)) { 
        $feeds =  @{}
    }
    else {
        $feeds = Import-CliXML $path
    }

    if($feeds.ContainsKey($packageName)) {
        return $feeds.$packageName
    }
    else {
        return (Get-BoxstarterDeployOptions).DefaultNugetFeed
    }
}
tools\Boxstarter.TestRunner\Get-BoxstarterPackagePublishedVersion.ps1
function Get-BoxstarterPackagePublishedVersion {
    [CmdletBinding()]
    param(
        [string]$PackageId,
        [URI]$Feed
    )

    try {
        if(!$feed) {
            return $null
        }
        else {
            $feedUrl="$feed/Packages/?`$filter=Id eq '$PackageId' and IsLatestVersion&`$select=Version"
            $downloader=new-object net.webclient
            $wp=[system.net.WebProxy]::GetDefaultProxy()
            $wp.UseDefaultCredentials=$true
            $downloader.Proxy=$wp
            [xml]$response = $downloader.DownloadString($feedUrl )
            $publishedPkg=$response.feed.entry
            return $publishedPkg.Properties.Version
        }
    }
    catch {
        Write-BoxstarterMessage "Error occurred querying $feed for published version of $packageId : $($_.Message)" -Verbose
    }
}
tools\Boxstarter.TestRunner\Get-FeedsAPIKeyPath.ps1
function Get-FeedsAPIKeyPath {
    $boxstarterScriptPath = join-Path $Boxstarter.LocalRepo "BoxstarterScripts"
    if(!(Test-Path $boxstarterScriptPath)) {
        mkdir $boxstarterScriptPath | Out-Null
    }
    return Join-Path $boxstarterScriptPath FeedAPIKeys.xml
}
tools\Boxstarter.TestRunner\Get-OptionsPath.ps1
function Get-OptionsPath {
    $boxstarterScriptPath = join-Path $Boxstarter.LocalRepo "BoxstarterScripts"
    if(!(Test-Path $boxstarterScriptPath)) {
        mkdir $boxstarterScriptPath | Out-Null
    }
    return Join-Path $boxstarterScriptPath Options.xml
}
tools\Boxstarter.TestRunner\Get-PackageFeedsPath.ps1
function Get-PackageFeedsPath {
    $boxstarterScriptPath = join-Path $Boxstarter.LocalRepo "BoxstarterScripts"
    if(!(Test-Path $boxstarterScriptPath)) {
        mkdir $boxstarterScriptPath | Out-Null
    }
    return Join-Path $boxstarterScriptPath PackageFeeds.xml
}
tools\Boxstarter.TestRunner\Get-SecretOptionsPath.ps1
function Get-SecretOptionsPath {
    $boxstarterScriptPath = join-Path $Boxstarter.LocalRepo "BoxstarterScripts"
    if(!(Test-Path $boxstarterScriptPath)) {
        mkdir $boxstarterScriptPath | Out-Null
    }
    return Join-Path $boxstarterScriptPath $env:ComputerName-$env:username-Options.xml
}
tools\Boxstarter.TestRunner\Install-BoxstarterScripts.ps1
function Install-BoxstarterScripts {
<#
.SYNOPSIS
Installs scripts in a Chocolatey package repository that can be used to 
integrate with Build servers and can bootstrap Boxstarter dependencies 
and test chocolatey package installs upon a commit to the repository.

.DESCRIPTION
Install-BoxstarterScripts adds a directory to a Chocolatey package 
repository named BoxstarterScripts. Scripts are then copied to this 
directory that can be triggered by a build process. the scripts include a 
MSBuild .proj file, a bootstrapper script that will download and install 
all necessary Boxstarter Modules and dependencies if needed, and a build 
script that performs the package tests and can publish successfully tested 
packages.

.PARAMETER RepoRootPath
The path that points to the root of the Chocolatey package repository.

.Example
Install-BoxstarterScripts c:\chocolatey-Packages

Creates a BoxstarterScripts folder at c:\Chocolatey-Packages\BoxstarterScripts 
that contains the scripts needed for a build server to call and invoke the 
testing and publishing of Chocolatey packages.

.LINK
http://boxstarter.org
#>
    [CmdletBinding()]
    param(
        [Parameter(Position=0,Mandatory=$true)]
        [ValidateScript({Test-Path $_})]
        [string]$RepoRootPath
    )
    
    $scriptPath = Join-Path $RepoRootPath BoxstarterScripts
    Write-BoxstarterMessage "Copying Boxstarter TestRunner scripts to $scriptPath"

    if(!(Test-Path $scriptPath)) { Mkdir $scriptPath | Out-Null }
    Copy-Item "$($Boxstarter.BaseDir)\Boxstarter.TestRunner\bootstrap.ps1" $scriptPath -Force 
    Copy-Item "$($Boxstarter.BaseDir)\Boxstarter.TestRunner\BoxstarterBuild.ps1" $scriptPath -Force 
    Copy-Item "$($Boxstarter.BaseDir)\Boxstarter.TestRunner\boxstarter.proj" $scriptPath -Force 
    Set-Content "$scriptPath\.gitignore" -Value "*-options.xml`r`nFeedAPIKeys.xml" -Force 
}
tools\Boxstarter.TestRunner\Publish-BoxstarterPackage.ps1
function Publish-BoxstarterPackage {
<#
.SYNOPSIS
Publishes a package to a Nuget feed

.DESCRIPTION
Publishes a package in the Boxstarter local repository to the Nuget feed 
it is associated with and using the API key that the feed has been 
assigned to. Set-BoxstarterPackageNugetFeed and Set-BoxstarterFeedAPIKey 
can be used to set the feed assigned to a package and the API key assigned 
to a feed. If no feed is explicitly assigned to a package, then the 
Default Nuget Feed of the BoxstarterDeployOptions is used. This can be set 
using Set-BoxstarterDeployOptions and if no default feed is set, the public 
chocolatey feed is used. A package feed can be cleared by using 
Remove-BoxstarterPackageNugetFeed. It will then use the default nuget feed. 
If you want to ensure that a package is never associated with a feed 
including the default feed, use Set-BoxstarterPackageNugetFeed and set
the feed to $null.

.PARAMETER PackageName

The name of the package in the Boxstarter LocalRepo to publish.

.Example
Set-BoxstarterPackageNugetFeed -PackageName MyPackage -NugetFeed https://www.myget.org/F/MyFeed/api/v2
Set-BoxstarterFeedAPIKey -NugetFeed https://www.myget.org/F/MyFeed/api/v2 -APIKey 2d2cfb67-8203-45d8-8a00-4e737f517c79
Publish-BoxstarterPackage MyPackage

Assigns the MyGet MyFeed to MyPackage and sets 
2d2cfb67-8203-45d8-8a00-4e737f517c79 as its API Key. When 
Publish-BoxstarterPackage is called for MyPackage, it is published to the 
MyFeed feed on MyGet.org using 2d2cfb67-8203-45d8-8a00-4e737f517c79.

.LINK
http://boxstarter.org
Get-BoxstarterPackageNugetFeed
Set-BoxstarterPackageNugetFeed
Remove-BoxstarterPackageNugetFeed
Get-BoxstarterFeedAPIKey
Set-BoxstarterFeedAPIKey
#>
    [CmdletBinding()]
    param(
        [parameter(Mandatory=$true, Position=0, ValueFromPipeline=$True)]
        [string[]]$PackageName
    )

    process {
        $PackageName | % {
            $err = $null
            $pkg = Get-BoxstarterPackage $_ 
            if($pkg -eq $null) {
                $err = "Could not find a package with ID $_ in the repository."
                Write-Error $err -Category InvalidArgument
            }
            elseif($pkg.Feed -eq $null) {
                $err = "Cannot publish $_ with no feed to publish to."
                Write-Error $err -Category InvalidOperation
            }
            elseif((Get-BoxstarterFeedAPIKey $pkg.Feed) -eq $null) {
                $err = "Cannot publish $_ to $($pkg.feed) with no API key."
                Write-Error $err -Category InvalidOperation
            }
            else {
                $err = @()
                $nupkg = join-path $Boxstarter.LocalRepo "$_.$($pkg.Version).nupkg"
                Write-BoxstarterMessage "Calling nuget: push $nupkg $(Get-BoxstarterFeedAPIKey $pkg.Feed) -Source $($pkg.Feed)/package -NonInteractive" -Verbose
                $err += Invoke-NugetPush $pkg $nupkg 2>&1
                try {
                    for($count = 1; $count -le 5; $count++) {
                        $publishedVersion = Get-BoxstarterPackagePublishedVersion $pkg.id $pkg.Feed -ErrorAction Stop
                        if($publishedVersion.length -gt 0 -and ($publishedVersion -eq $pkg.Version) ) { break }
                        Write-BoxstarterMessage "no published version found, Trying again." -Verbose
                        if(!$script:testing){Start-Sleep -seconds 10}
                    }
                }
                catch{
                    $err += $_
                }
                if($publishedVersion -eq $null -or $publishedVersion -ne $pkg.Version) {
                    write-Error ($err -join ", " )
                }
                else {
                    $err = $null
                }
            }
            [PSCustomObject]@{
                Package=$(if($pkg.Id){$pkg.Id}else{$_})
                Feed=$pkg.Feed
                PublishedVersion=$publishedVersion
                PublishErrors=$err
            }
        }
    }
}

function Invoke-NugetPush ($pkg,$nupkg) {
    $nuget="$env:ChocolateyInstall\chocolateyinstall\Nuget.exe"
    .$nuget push $nupkg (Get-BoxstarterFeedAPIKey $pkg.Feed) -Source "$($pkg.Feed)/package" -NonInteractive
}
tools\Boxstarter.TestRunner\Remove-BoxstarterPackageNugetFeed.ps1
function Remove-BoxstarterPackageNugetFeed {
<#
.SYNOPSIS
Removes the Nuget feed associated with an individual package.

.DESCRIPTION
A Chocolatey package repository may publish different packages to 
different feeds. Remove-BoxstarterPackageNugetFeed removes the Nuget 
feed associated with a specified package name. After doing so, the 
package will be associated with the DefaultNugetFeed that can be set 
with Set-BoxstarterDeployOptions and is set to the public Chocolatey 
feed by default. If you do not want any feed to be associated with a 
package, explicitly use Set-BoxstarterPackageNugetFeed to set the 
feed of a package to $null.

.PARAMETER PackageName
The name of a Chocolatey package in the local repository for which the 
feed should be removed.

.Example
Remove-BoxstarterPackageNugetFeed MyPackageName

Removes the Nuget feed associated with MyPackageName

.LINK
http://boxstarter.org
Set-BoxstarterPackageNugetFeed
Get-BoxstarterPackageNugetFeed
Set-BoxstarterDeployOptions
Get-BoxstarterDeployOptions
#>
    [CmdletBinding()]
    param (
        [string]$packageName
    )
    $path=Get-PackageFeedsPath
    if(!(Test-Path $path)) { 
        $feeds =  @{}
    }
    else {
        $feeds = Import-CliXML $path
    }

    $feeds.Remove($packageName)
    $feeds | Export-CliXML ($path)
}
tools\Boxstarter.TestRunner\Select-BoxstarterResultsToPublish.ps1
function Select-BoxstarterResultsToPublish {
<#
.SYNOPSIS
Returns successful Boxstarter packages from provided test results 
eligible to be published to a nuget feed.

.DESCRIPTION
Test-BoxstarterPackage will return a set of test results given an 
array of packages or an entire repository. Select-BoxstarterResultsToPublish
can consume these results and return the package IDs of the packages who 
had all test machines pass the package install. One could then have
Publish-BoxstarterPackage consume this output and publish those packages 
to their respectful feeds.

.PARAMETER Results
An array of PSObjects returned from Test-BostarterPackages. These 
objects contain metadata about a packages' test run on a single test 
machine. The data will report if the test completed and if there were 
any exceptions.

.EXAMPLE
Test-BoxstarterPackages | Select-BoxstarterResultsToPublish | Publish-BoxstarterPackage

This will test all packages in the Boxstarter LocalRepo that have a 
repository version greater than its published version. The results of
the tests will be passed to Select-BoxstarterResultsToPublish to 
choose the packages which passed on all test machines. 
Set-BoxstarterDeployOptions can be used to designate the machines to 
be used for testing. The successful packages are then piped to 
Publish-BoxstarterPackage which publishes the packages to their 
associated nuget feed.

.LINK
http://boxstarter.org
Test-BoxstarterPackage
Publish-BoxstarterPackage
Set-BoxstarterDeployOptions
#>
    [CmdletBinding()]
    param(
        [parameter(Mandatory=$true, Position=0, ValueFromPipeline=$True)]
        [PSObject[]]$Results
    )
    Begin {
        $succesfullPackages = @()
        $failedPackages = @()
    }
    Process {
        $Results | % {
            if($_.Status -eq "failed"){
                $failedPackages += $_.Package
            }
            if($_.Status -eq "passed" -and ($succesfullPackages -notcontains $_.Package)){
                $succesfullPackages += $_.Package
            }
        }
    }
    End {
        $succesfullPackages | ? {
            $failedPackages -notcontains  $_
        } | % {
            $_
        }
    }
}
tools\Boxstarter.TestRunner\Set-BoxstarterDeployOptions.ps1
function Set-BoxstarterDeployOptions {
<#
.SYNOPSIS
Configures settings related to boxstarter package deployment to test 
machines and Nuget packages.

.DESCRIPTION
Boxstarter tests Chocolatey packages by deploying and installing the 
package to a remote machine. The deployment options include settings 
that control what computers to use to test the packages, the credentials 
to use, VM checkpoints to snap as well as nuget feed and API key for 
publishing succesful packages. To read the curent settings for these 
options, use Get-BoxstarterDeploymentOptions.

.PARAMETER DeploymentTargetCredentials
The credentials to use for deploying packages to the Deployment Targets

.PARAMETER DeploymentTargetNames
Names of test targets where packages will be tested. These can be either 
computer names or VM names if using one of the VM providers. The default 
is localhost. When testing locally, Reboots are disabled.

.PARAMETER DeploymentVMProvider
The name of the VM provider if the deployment targts are managed using 
one of the Boxstarter VM Providers: HyperV or Azure.

.PARAMETER DeploymentCloudServiceName
If using the Azure VM Provider, this is the cloud service that hosts the VM.

.PARAMETER RestoreCheckpoint
If using one of the VM Provider, this specifies a checkpoint name from which 
point the package install should begin. If the checkpoint does not exist, 
it will be saved just before the install.

.PARAMETER DeploymentTargetPassword
Password to use when authenticating remote sessions on the deployment 
targets. Using the DeploymentTargetCredentials is preferred but explicitly 
providing a username and password may be necesary for some build server 
scenarios.

.PARAMETER DeploymentTargetUserName
UserName to use when authenticating remote sessions on the deployment 
targets. Using the DeploymentTargetCredentials is preferred but explicitly 
providing a username and password may be necesary for some build server 
scenarios.

.PARAMETER DefaultNugetFeed
If an individual package has not been assigned to a specific Nugetr feed, 
Boxstarter will fall back to this feed unless the package was explicitly 
set to $null.

.PARAMETER DefaultFeedAPIKey
The API key to use when when publishing a package to the default feed.

.NOTES
Set-BoxstarterDeployOptions can set one or all possible settings. These 
settings are persisted to a file and all credential and API key is 
encrypted. Using the DeploymentTargetCredentials is preferred over explicitly
providing a username and password. But the later may be necesary for a 
very limited set of build server scenarios.

.EXAMPLE
$cred=Get-Credential Admin
Set-BoxstarterDeployOptions -DeploymentTargetCredentials $cred `
  -DeploymentTargetNames "testVM1","testVM2" `
  -DeploymentVMProvider Azure -DeploymentCloudServiceName ServiceName `
  -RestoreCheckpoint clean `
  -DefaultNugetFeed https://www.myget.org/F/mywackyfeed/api/v2 `
  -DefaultFeedAPIKey 5cbc38d9-1a94-430d-8361-685a9080a6b8

This configures package deployments for Azure VMs testVM1 and testVM2 
hosted in the ServiceName service using the Admin credential. Prior to 
testing a package install, the VM will be restored to the clean 
checkpoint. If packages are published and are not associated with a
Nuget feed, they will publish to the mywackyfeed on myget.org using API 
Key 5cbc38d9-1a94-430d-8361-685a9080a6b8

.LINK
http://boxstarter.org
Get-BoxstarterDeployOptions 
#>
    [CmdletBinding(DefaultParameterSetName='Credential')]
    param(
        [Parameter(ParameterSetName="Credential")]
        [Management.Automation.PsCredential]$DeploymentTargetCredentials,
        [Parameter(ParameterSetName="UserPass")]
        [string]$DeploymentTargetPassword,
        [Parameter(ParameterSetName="UserPass")]
        [string]$DeploymentTargetUserName,
        [string[]]$DeploymentTargetNames,
        [string]$DeploymentVMProvider,
        [string]$DeploymentCloudServiceName,
        [string]$RestoreCheckpoint,
        [Uri]$DefaultNugetFeed,
        [GUID]$DefaultFeedAPIKey
    )
    $options=Get-BoxstarterDeployOptions
    if($PSBoundParameters.Keys -contains "DeploymentTargetCredentials"){$options.DeploymentTargetCredentials = $DeploymentTargetCredentials}
    if($PSBoundParameters.Keys -contains "DeploymentTargetNames"){$options.DeploymentTargetNames = $DeploymentTargetNames}
    if($PSBoundParameters.Keys -contains "DeploymentVMProvider"){$options.DeploymentVMProvider = $DeploymentVMProvider}
    if($PSBoundParameters.Keys -contains "DeploymentCloudServiceName"){$options.DeploymentCloudServiceName = $DeploymentCloudServiceName}
    if($PSBoundParameters.Keys -contains "RestoreCheckpoint"){$options.RestoreCheckpoint = $RestoreCheckpoint}
    if($PSBoundParameters.Keys -contains "DefaultNugetFeed"){$options.DefaultNugetFeed = $DefaultNugetFeed}
    
    if($PSBoundParameters.Keys -contains "DeploymentTargetUserName"){
        $secpasswd = ConvertTo-SecureString $DeploymentTargetPassword -AsPlainText -Force
        $options.DeploymentTargetCredentials = New-Object System.Management.Automation.PSCredential ($DeploymentTargetUserName, $secpasswd)
    }
    $options.DeploymentTargetCredentials | Export-CliXML (Get-SecretOptionsPath)
    $options.Remove("DeploymentTargetCredentials")

    if($PSBoundParameters.Keys -contains "DefaultFeedAPIKey"){
        Set-BoxstarterFeedAPIKey -NugetFeed $options.DefaultNugetFeed -APIKey $DefaultFeedAPIKey
    }
    $options.Remove("DefaultFeedAPIKey")

    $options | Export-CliXML (Get-OptionsPath)
}
tools\Boxstarter.TestRunner\Set-BoxstarterFeedAPIKey.ps1
function Set-BoxstarterFeedAPIKey {
<#
.SYNOPSIS
Sets the API key for the specified Nuget feed

.DESCRIPTION
Boxstarter can automatically publish a succesfully tested Chocolatey 
package to its asociated feed. In order for this to work, Boxstarter 
must have a valid API key authorized to publish to the feed. 
Set-BoxstarterFeedAPIKey associates an individual API key with a 
given nuget feed url. Use Get-BoxstarterFeedAPIKey to retrieve 
a key associated with a feed.

.PARAMETER NugetFeed
The URI of a Nuget feed for which the API key is being associated.

.PARAMETER APIKey
The GUID API Key to assiciate with the feed.

.NOTES
These keys are persisted to a file in encrypted format.

.Example
Set-BoxstarterFeedAPIKey -NugetFeed "http://chocolatey.org/api/v2" `
  -APIKey 5cbc38d9-1a94-430d-8361-685a9080a6b8

Sets the API Key used with the public Chocolatey feed to 
5cbc38d9-1a94-430d-8361-685a9080a6b8.

.LINK
http://boxstarter.org
Get-BoxstarterFeedAPIKey
#>
    [CmdletBinding()]
    param (
        [Uri]$NugetFeed,
        [GUID]$APIKey
    )
    $path=Get-FeedsAPIKeyPath
    if(!(Test-Path $path)) { 
        $keys =  @{}
    }
    else {
        $keys = Import-CliXML $path
    }

    $keys[$NugetFeed] = $APIKey
    $keys | Export-CliXML ($path)
}
tools\Boxstarter.TestRunner\Set-BoxstarterPackageNugetFeed.ps1
function Set-BoxstarterPackageNugetFeed {
<#
.SYNOPSIS
Sets the Nuget feed associated with an individual package.

.DESCRIPTION
A Chocolatey package repository may publish different packages to 
different feeds. Set-BoxstarterPackageNugetFeed sets the Nuget 
feed associated with a specified package name. 
Get-BoxstarterPackageNugetFeed can be used to retrieve the feed 
associated with a package. One may also use Set-BoxstarterDeployOptions 
and use the DefaultNugetFeed parameter to specify which feed to use for 
a package if no feed is specified. If you do not want any feed to be 
associated with a package, explicitly use Set-BoxstarterPackageNugetFeed 
to set the feed of a package to $null.

.PARAMETER PackageName
The name of a Chocolatey package in the local repository for which a 
feed should be associated.

.PARAMETER NugetFeed
The Nuget feed to associate with the Chocolatey package.

.NOTES
These feed associations are persisted to a file so thet they can be 
reused in all subsequent sessions.

.Example
set-BoxstarterPackageNugetFeed -PackageName MyPackage `
  -NugetFeed https://www.myget.org/F/mywackyfeed/api/v2

Sets the package MyPackage to the MyGet.org mywackyfeed 

.LINK
http://boxstarter.org
Get-BoxstarterPackageNugetFeed
Remove-BoxstarterPackageNugetFeed
Set-BoxstarterDeployOptions
Get-BoxstarterDeployOptions
#>
    [CmdletBinding()]
    param (
        [string]$PackageName,
        [Uri]$NugetFeed
    )
    if(!(Test-Path "$($Boxstarter.LocalRepo)\$PackageName")) {
        throw New-Object -TypeName InvalidOperationException -ArgumentList "The $PackageName package could not be found. There is no directory $($Boxstarter.LocalRepo)\$PackageName"
    }

    $path=Get-PackageFeedsPath
    if(!(Test-Path $path)) { 
        $feeds =  @{}
    }
    else {
        $feeds = Import-CliXML $path
    }

    $feeds.$PackageName = $NugetFeed
    $feeds | Export-CliXML ($path)
}
tools\Boxstarter.TestRunner\Test-BoxstarterPackage.ps1
function Test-BoxstarterPackage {
<#
.SYNOPSIS
Tests a set of Boxstarter Packages or all changed packages in the 
Boxstarter Local Repository.

.DESCRIPTION
Test-BoxstarterPackage can be called with an array of packages which 
boxstarter will then build their .nupkg files and attempt to install 
them on the deployment targets specified with 
Set-BoxstarterDeploymentOptions. Boxstrtr will use the credentials 
provided in the deployment options. You can provide several targets to 
Set-BoxstarterDeploymentOptions. One may wish to supply different 
machines running different versions of windows. If a package install runs 
to completion with no exceptions or returned error codes, Boxstarter 
considers the install a PASSED test. If Test-BoxstarterPackage is called 
with no packages specified, Boxstarter will iterate over each package in 
its local repository. It will build the nupkg and compare its version to 
the version on the package's published feed. If the version in the repo 
is greater then the published version, Boxstarter will initiate a test on 
the deployment targets otherwise the package test will be skipped.

If any of the deployment targets are Azure VMs in a stopped state, Boxstarter
will shutdown those machines when all testing is complete.

.PARAMETER
One or more package names of packages located in Boxstarter's local 
repository to test. If no package names are provided, all packages with a 
version greater than the package's published version will be tested.

.EXAMPLE
Set-BoxstarterConfig -LocalRepo c:\dev\boxstarterRepo
$cred=Get-Credential Admin
Set-BoxstarterDeployOptions -DeploymentTargetCredentials $cred `
  -DeploymentTargetNames "testVM1","testVM2" `
  -DeploymentVMProvider Azure -DeploymentCloudServiceName ServiceName `
  -RestoreCheckpoint clean `
  -DefaultNugetFeed https://www.myget.org/F/myfeed/api/v2 `
Test-BoxstarterPackage

All chocolatey packages in c:\dev\boxstarterRepo are built and their 
versions are evaluated against the versions published on the myFeed feed 
at MyGet.org. Those with a local version higher than the one published will
be installed on testVM1 and testVM2.

.EXAMPLE
Test-BoxstarterPackage MyPackage

The MyPackage package in the local boxstarter repo is built and installed on 
the configured deployment target machines regardless of the version of 
MyPackage.

.LINK
http://boxstarter.org
Set-BoxstarterDeployOptions 
Set-BoxstarterFeedAPIKey
Set-BoxstarterPackageNugetFeed

#>
    [CmdletBinding()]
    param(
        [string[]]$PackageName
    )
    $options = Get-BoxstarterDeployOptions
    if(!$options.DeploymentTargetCredentials -and ($options.DeploymentTargetNames -ne "localhost")){
        throw "No DeploymentTargetCredentials has been sent. Use Set-BoxstarterBuildOptions to set DeploymentTargetCredentials"
    }

    if($options.DeploymentVMProvider -and $options.DeploymentVMProvider -gt 0){
        [email protected]{}
        $cloudVMStates = @{}
        if($options.DeploymentCloudServiceName){$vmArgs.CloudServiceName=$options.DeploymentCloudServiceName}
        if($options.RestoreCheckpoint){$vmArgs.CheckpointName=$options.RestoreCheckpoint}
        $vmArgs.Provider=$options.DeploymentVMProvider
        if($options.DeploymentVMProvider -eq "azure") {
            Write-BoxStarterMessage "Using Azure VMs. Checking to see if these are shutdown..." -verbose
            $options.DeploymentTargetNames | % {
                $thisState = Test-VMStarted $options.DeploymentCloudServiceName $_
                Write-BoxStarterMessage "Is $_ on: $thisState" -verbose
                $cloudVMStates.$_ = $thisState
            }
        }
    }

    [email protected]{
        Passed=0
        Skipped=0
        Failed=0
    }

    $currentColor = $Host.UI.RawUI.ForegroundColor
    $summaryColor = "Green"
    Update-FormatData  -PrependPath "$($Boxstarter.BaseDir)\Boxstarter.TestRunner\TestResult.Format.ps1xml"
    $CurrentVerbosity=$global:VerbosePreference

    try {
        if($PSBoundParameters["Verbose"] -eq $true) {
            $global:VerbosePreference="Continue"
        }

        Get-BoxstarterPackage -PackageName $PackageName | % {
            $Host.UI.RawUI.ForegroundColor = $currentColor
            $pkg = $_
            if($PackageName -or (Test-PackageVersionGreaterThanPublished $pkg)) {
                Invoke-BuildAndTest $pkg.Id $options $vmArgs | % {
                    if($_.Status -eq "PASSED") {
                        $summary.Passed++
                        $Host.UI.RawUI.ForegroundColor = "Green"
                    }
                    else {
                        $summary.Failed++
                        $Host.UI.RawUI.ForegroundColor = "Red"
                        $summaryColor= "Red"
                    }
                    Write-Result $pkg $_
                }
                if(!$failed) {$publishCandidates += $pkg.Id}
            }
            else {
                $summary.Skipped++
                Write-Result $pkg
            }
        }
    }
    finally{
        $Host.UI.RawUI.ForegroundColor = $currentColor
        $global:VerbosePreference=$CurrentVerbosity

        $cloudVMStates.Keys | ? { $cloudVMStates.$_ -eq $false -and (Test-VMStarted $options.DeploymentCloudServiceName $_)} | % {
            Write-BoxStarterMessage "Stopping $_..."
            Stop-AzureVM  -ServiceName $options.DeploymentCloudServiceName -Name $_ -Force | Out-Null 
        }
    }

    Write-BoxstarterMessage "Total: $($summary.Passed + $summary.Failed + $summary.Skipped) Passed: $($summary.Passed) Failed: $($summary.Failed) Skipped: $($summary.Skipped)" -Color $summaryColor
}

function Write-Result($package, $result) {
    $res = New-Object PSObject -Property @{
        Package=$package.Id
        RepoVersion=$package.Version
        PublishedVersion=$(if($package.PublishedVersion -eq $null) {"Not Published"} else { $package.PublishedVersion })
        Computer=$result.TestComputerName
        ResultDetails=$(if($result -eq $null) {@{}} else { $result.ResultDetails })
        Status=$(if($result -eq $null) {"SKIPPED"} else { $result.Status })
    }
    $res.PSObject.TypeNames.Insert(0,'BoxstarterTestResult')
    $res | Out-BoxstarterLog -quiet
    return $res
}

function Test-PackageVersionGreaterThanPublished ($package) {
    if(!$package.Feed) { 
        Write-BoxstarterMessage "No feed has been assigned to $($package.Name). It will not be built and tested" -verbose
        return $false 
    }

    if(!$package.PublishedVersion) {
        Write-BoxstarterMessage "$($package.Name) has not yet been published. It will be built and tested" -verbose
        return $true 
    }

    try {
        $pkgVersion=New-Object -TypeName Version -ArgumentList (Remove-PreRelease $package.Version)
    }
    catch [System.Management.Automation.MethodInvocationException] {
        Write-Error "cannot parse version from $(Remove-PreRelease $package.Version)" -Category InvalidOperation
    }
    $pubVersion=New-Object -TypeName Version -ArgumentList (Remove-PreRelease $package.PublishedVersion)

    if($pkgVersion -gt $pubVersion) {
        Write-BoxstarterMessage "The repository version '$($package.Version)' for $($package.Name) is greater than the published version '$($package.PublishedVersion)'. It will be built and tested" -verbose
        return $true 
    }
    else {
        Write-BoxstarterMessage "The repository version '$($package.Version)' for $($package.Name) is not greater than the published version '$($package.PublishedVersion)'. It will not be built and tested" -verbose
        return $false 
    }
}

function Remove-PreRelease ([string]$versionString) {
    $idx=$versionString.IndexOf("-")
    if($idx -gt -1) {
        return $versionString.Substring(0,$idx)
    }
    else {
        return $versionString 
    }
}

function Invoke-BuildAndTest($packageName, $options, $vmArgs) {
    $origLogSetting=$Boxstarter.SuppressLogging
    if($global:VerbosePreference -eq "Continue") {
        Write-BoxstarterMessage "Verbosity is on" -verbose
        $verbose = $true 
    }
    else {
        Write-BoxstarterMessage "Verbosity is off" -verbose
        $verbose = $false 
    }
    if(!$verbose){ 
        $Boxstarter.SuppressLogging=$true 
    }
    $progressId=5000 #must be a unique int. This is likely not to conflict with anyone else
    try {
        Write-Progress -id $progressId "Building $packageName."
        Invoke-BoxstarterBuild $packageName -Quiet

        $options.DeploymentTargetNames | % {
            $target=$_
            $global:[email protected]{Id=$progressId;Activity="Testing $packageName";Status="on Machine: $target"}
            $a=$global:Boxstarter.ProgressArgs
            Write-Progress @a
            $boxstarterConn=$null
            $result=$null
            try {
                if($vmArgs) {
                    $vmArgs.Keys | % {
                        Write-BoxstarterMessage "vm arg key: $_ has value $($vmArgs[$_])" -Verbose
                    }
                    Write-BoxstarterMessage "connecting to $target using credential username $($options.DeploymentTargetCredentials.UserName)" -Verbose
                    $boxstarterConn = Enable-BoxstarterVM -Credential $options.DeploymentTargetCredentials -VMName $target  @vmArgs -Verbose:$verbose
                }
                else {
                    $boxstarterConn = $target
                }
                if($boxstarterConn -ne "localhost") {
                    $result = $boxstarterConn | Install-BoxstarterPackage -credential $options.DeploymentTargetCredentials -PackageName $packageName -Force -verbose:$verbose
                }
                else {
                    $result = Install-BoxstarterPackage -DisableReboots -PackageName $packageName -Force -verbose:$verbose
                }
            }
            catch {
                $result = $_
            }
            if(Test-InstallSuccess $result) {
                $status="PASSED"
            }
            else {
                $status="FAILED"
            }
            new-Object PSObject -Property @{
                Package=$packageName 
                TestComputerName=$target
                ResultDetails=$result
                Status=$status
            }
        }
    }finally { 
        $Boxstarter.SuppressLogging = $origLogSetting
        $global:Boxstarter.Remove("ProgressArgs")
    }
}

function Test-InstallSuccess ($testResult) {
    if($testResult.Completed -and ($testResult.Errors.Count -eq 0)) {
        return $true
    }
    return $false
}
tools\Boxstarter.TestRunner\TestResult.Format.ps1xml
 
tools\chocolateyinstall.ps1
$tools = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
. (Join-Path $tools Setup.ps1)
try { 
    $ModuleName = (Get-ChildItem $tools | ?{ $_.PSIsContainer }).BaseName
    Install-Boxstarter "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" $ModuleName
    Write-ChocolateySuccess $ModuleName
} catch {
    Write-ChocolateyFailure $ModuleName "$($_.Exception.Message)"
    throw 
}
tools\LICENSE.txt
                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.
tools\setup.ps1
function Install-Boxstarter($here, $ModuleName) {
    $boxstarterPath=Join-Path $env:AppData Boxstarter
    if(!(test-Path $boxstarterPath)){
        mkdir $boxstarterPath
    }
    $packagePath=Join-Path $boxstarterPath BuildPackages
    if(!(test-Path $packagePath)){
        mkdir $packagePath
    }    
    foreach($ModulePath in (Get-ChildItem $here | ?{ $_.PSIsContainer })){
        $target=Join-Path $boxstarterPath $modulePath.BaseName
        if(test-Path $target){
            Remove-Item $target -Recurse -Force
        }
    }
    Copy-Item "$here\*" $boxstarterPath -Recurse -Force -Exclude ChocolateyInstall.ps1, Setup.*

    PersistBoxStarterPathToEnvironmentVariable "PSModulePath"
    PersistBoxStarterPathToEnvironmentVariable "Path"
    $binPath =  "$here\..\..\..\bin"
    $boxModule=Get-Module Boxstarter.Chocolatey
    if($boxModule) {
        if($boxModule.Path -like "$env:LOCALAPPDATA\Apps\*") {
            $clickonce=$true
        }
    }
    if(!$clickonce){
        Import-Module "$boxstarterPath\$ModuleName" -DisableNameChecking -Force -ErrorAction SilentlyContinue
    }
    $successMsg = @"
The $ModuleName Module has been copied to $boxstarterPath and added to your Module path. 
You will need to open a new console for the path to be visible.
Use 'Get-Module Boxstarter.* -ListAvailable' to list all Boxstarter Modules.
To list all available Boxstarter Commands, use:
PS:>Import-Module $ModuleName
PS:>Get-Command -Module Boxstarter.*

To find more info visit http://Boxstarter.org or use:
PS:>Import-Module $ModuleName
PS:>Get-Help Boxstarter
"@
    Write-Host $successMsg

    if($ModuleName -eq "Boxstarter.Chocolatey") {
        $desktop = $([System.Environment]::GetFolderPath([System.Environment+SpecialFolder]::DesktopDirectory))
        $startMenu=$("$env:appdata\Microsoft\Windows\Start Menu\Programs\Boxstarter")
        if(!(Test-Path $startMenu)){
            mkdir $startMenu
        }
        $target="powershell.exe"
        $targetArgs="-ExecutionPolicy bypass -NoExit -Command `"&'$boxstarterPath\BoxstarterShell.ps1'`""

        $link = Join-Path $desktop "Boxstarter Shell.lnk"
        Create-Shortcut $link $target $targetArgs $boxstarterPath

        $link = Join-Path $startMenu "Boxstarter Shell.lnk"
        Create-Shortcut $link $target $targetArgs $boxstarterPath

        Set-Content -Path "$binPath\BoxstarterShell.bat" -Force -Value "$target $TargetArgs"
    }

}

function Create-Shortcut($location, $target, $targetArgs, $boxstarterPath) {
    $wshshell = New-Object -ComObject WScript.Shell
    $lnk = $wshshell.CreateShortcut($location)
    $lnk.TargetPath = $target
    $lnk.Arguments = "$targetArgs"
    $lnk.WorkingDirectory = $boxstarterPath
    $lnk.IconLocation="$boxstarterPath\BoxLogo.ico"
    $lnk.Save()

	$tempFile = "$env:temp\TempShortcut.lnk"
		
	$writer = new-object System.IO.FileStream $tempFile, ([System.IO.FileMode]::Create)
	$reader = new-object System.IO.FileStream $location, ([System.IO.FileMode]::Open)
		
	while ($reader.Position -lt $reader.Length)
	{		
		$byte = $reader.ReadByte()
		if ($reader.Position -eq 22) {
			$byte = 34
		}
		$writer.WriteByte($byte)
	}
		
	$reader.Close()
	$writer.Close()
				
	Move-Item -Path $tempFile $location -Force
}
function PersistBoxStarterPathToEnvironmentVariable($variableName){
    $value = [Environment]::GetEnvironmentVariable($variableName, 'User')
    if($value){
        $values=($value -split ';' | ?{ !($_.ToLower() -match "\\boxstarter$")}) -join ';'
        $values+=";$boxstarterPath"
    } 
    elseif($variableName -eq "PSModulePath") {
        $values=[environment]::getfolderpath("mydocuments")
        $values +="\WindowsPowerShell\Modules;$boxstarterPath"
    }
    else {
        $values ="$boxstarterPath"
    }
    if(!$value -or !($values -contains $boxstarterPath)){
        $values = $values.Replace(';;',';')
        [Environment]::SetEnvironmentVariable($variableName, $values, 'User')
        $varValue = Get-Content env:\$variableName
        $varValue += ";$boxstarterPath"
        $varValue = $varValue.Replace(';;',';')
        Set-Content env:\$variableName -value $varValue
    }
}

In cases where actual malware is found, the packages are subject to removal. Software sometimes has false positives. Moderators do not necessarily validate the safety of the underlying software, only that a package retrieves software from the official distribution point and/or validate embedded software against official distribution point (where distribution rights allow redistribution).

Chocolatey Pro provides runtime protection from possible malware.

Version Downloads Last Updated Status
Boxstarter Test Runner Module 2.11.0 133 Wednesday, May 16, 2018 Approved
Boxstarter Test Runner Module 2.10.3 591 Thursday, July 27, 2017 Approved
Boxstarter Test Runner Module 2.9.26 256 Monday, June 19, 2017 Approved
Boxstarter Test Runner Module 2.9.24 229 Sunday, June 18, 2017 Approved
Boxstarter Test Runner Module 2.9.14 230 Friday, May 5, 2017 Approved
Boxstarter Test Runner Module 2.9.5 223 Thursday, March 30, 2017 Approved

  • Fixes Invoke-Reboot from a nested package and bubbles up the reboot signal
    • Update docs to reflect github as repo home and remove all codeplex links
    • Fix for all write-host calls being logged to Boxstarter log file even when there is no install session in progress
    • fixing issue where auto login is not disabled after boxstarter run
    • fixing wait for published version to retry for a minute if the new version is not yet marked published
    • Improve initial connectin performance by skipping remoting check if it has already been tested in enable-BoxstarterVM
    • provide messaging for some winconfig functions
    • fix the setting of azure storage account by looking for https endpoints
    • load storage module before azure to workaround bug with the storage module loading
    • copy the root path passed to New_BoxstarerPackage
    • add a DisableRestart parameter which will suppress the restart file and UAC enabling
    • Greatly improve progress messaging during windows updates runs
    • Fix hang scenarios when waiting for remote machine to reboot and landing in a pending reboot state shortly after reboot
    • Support for auto login and restart in winrm sessions
    • Fix issue with remote check causing an indefinite loop
    • Silencing some handled errors and keep them from leaking to the pipeline
    • Reduce WMI calls and Improve performance of testing if the current session is remote
    • When forcing the install of the outer boxstarter package, make sure to delete the last install from the right repo
    • Check scheduled task output for pending reboots after a remote windows update since 32 bit processes cant read the wsus registry keys
    • Fix Remote check when running as a servise
    • System user logs to programdata
    • when accessing a 64 bit machine from a 32bit process, the windowsupdate reg key is hidden so skip it
    • Bubble up errors from windows update
    • Provide the same scheduled task wrapping for winrm as we do for ps remoting
    • fix explorer restart when there is no explorer process
    • Correcting fallback Chocolatey install path to match release 0.9.8.24
    • Fixing typo param name in redirect call to set-WindowsExplorerOptions
    • Fix InvalidArgument from Set-TaskbarOptions when using lock or unlock params
    • Fix issues where explorer terminates and cannot restart after caling one of the winconfig functions
    • Import azure module from the pipeline to avoid errors when loading Boxstarter.azure
    • Suppress errors when reenabling windows update in case they had alrady been reenabled
    • Fix mis encoded dash in Install-Boxstarterackage
    • Fix issues when Chocolatey packages create a new module and call chocolatey functions from that module
    • When building packages, skip folders without a nuspec instead of throwing an error
    • Only restart the explore process of the current user when calling windows config functions
    • Fixing .net 4.5 install for local installs
    • Fixing TestRunner module loading for PSv2 clients
    • Add the following windows config features:
    • Enable/Disable showing charms when mouse is in the upper right corner
    • Enable/Disable switching apps when pointing in the upper left corner
    • Enable/Disable the option to launch powershell from win-x
    • Enable/Disable boot to desktop
    • Enable/Disable desktop background on the start screen
    • Enable/Disable showing the start screen on the active display
    • Enable/Disable showing the Apps View by default on the start screen
    • Enable/Disable searching everywhere in apps view. Not just apps.
    • Enable/Disable showing desktop apps first in results
    • Lock/Unlock task bar
    • Change taskbar icon size
    • Change location of taskbar docking
    • Add test and publish automation that can point to remote deployment targets
    • Provide build scripts for integration of tests and publishing in CI servers
    • Include configured nuget sources and local repo to all chocolatey install calls and not just the initial package
    • Fix enabling powershell remoting via WMI when password has ampersands
    • Avoid explorer.exe crashes when configuring explorer options
    • Fix Hyper-V heartbeat check in non US locales
    • Fix Azure module loading in 32 bit consoles
    • Fix shell shortcuts when user name has a space
    • Fix Azure VM Checkpoint listing when there are more than one VM in a service
    • Install .net 4.5 ONLY without affecting IIS settings when .net 4 is not present
    • Fix Azure VM integration when multiple subscriptions are present
    • Allow remote installs to be run by a non amin user

Discussion for the Boxstarter Test Runner Module Package

Ground Rules:

  • This discussion is only about Boxstarter Test Runner Module and the Boxstarter Test Runner Module package. If you have feedback for Chocolatey, please contact the Google Group.
  • This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
  • The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
  • Tell us what you love about the package or Boxstarter Test Runner Module, or tell us what needs improvement.
  • Share your experiences with the package, or extra configuration or gotchas that you've found.
  • If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.
comments powered by Disqus