Invoke-ChocolateyBoxstarter

SYNOPSIS

Invokes the installation of a Boxstarter package

SYNTAX

Invoke-ChocolateyBoxstarter [-bootstrapPackage <String>] [-localRepo
<Switch>] [-DisableReboots <SecureString>] [-Password <CommonParameters>]
[-NoNewWindow <Switch>]

SYNOPSIS

Invokes the installation of a Boxstarter package

DESCRIPTION

This essentially wraps Chocolatey Install and provides these additional features
  • Installs chocolatey if it is not already installed
  • Installs the .net 4.5 framework if it is not installed which is a chocolatey requirement
Disables windows update service during installation to prevent installation conflicts and minimize the need for reboots
  • Imports the Boxstarter.WinConfig module that provides functions for customizing windows
  • Detects pending reboots and restarts the machine when necessary to avoid installation failures
  • Provides Reboot Resiliency by ensuring the package installation is immediately restarted up on reboot if there is a reboot during the installation.
  • Ensures everything runs under admin

The .nupkg file for the provided package name is searched in the following locations and order:
  • .\BuildPackages relative to the parent directory of the module file
  • The chocolatey feed
  • The boxstarter feed on myget
This can be configured by editing $($Boxstarter.BaseDir)\Boxstarter.Config

If the package name provided is a URL or resolves to a file. Then
it is assumed that this contains the chocolatey install script and
a .nupkg file will be created using the script.

PARAMETER BootstrapPackage

The name of a NugetPackage The package to be installed or a URI or
file path pointing to a chocolatey script. If using a package name,
the .nupkg file for the provided package name is searched in the following locations and order:
  • .\BuildPackages relative to the parent directory of the module file
  • The chocolatey feed
  • The boxstarter feed on myget

Parameter Localrepo

This is the path to the local boxstarter repository where boxstarter
should look for .nupkg files to install. By default this is located
in the BuildPackages directory just under the root Boxstarter
directory but can be changed with Set-BoxstarterConfig.

PARAMETER DisableReboots

If set, reboots are suppressed.

PARAMETER Password

User's password as a Secure string to be used for reboot autologons.
This will suppress the password prompt at the beginning of the
Boxstarter installer.

PARAMETER KeepWindowOpen

Enabling this switch will prevent the command window from closing and
prompt the user to pres the Enter key before the window closes. This
is ideal when not invoking boxstarter from a console.

PARAMETER NoPassword

When set, Boxstarter will never prompt for logon. Use this if using
an account without password validation.

EXAMPLE

Invoke-ChocolateyBoxstarter example

This invokes boxstarter and installs the example .nupkg. If pending
reboots are detected, boxstarter will restart the machine. Boxstarter
will prompt the user to enter a password which will be used for
automatic logins in the event a restart is required.

EXAMPLE

Invoke-ChocolateyBoxstarter https://gist.github.com/mwrock/6771863/raw/b579aa269c791a53ee1481ad01711b60090db1e2/gistfile1.txt

This invokes boxstarter and installs the script uploaded to the github gist.

EXAMPLE

Invoke-ChocolateyBoxstarter script.ps1

This invokes boxstarter and installs the script located at script.ps1
in the command line's current directory.

EXAMPLE

Invoke-ChocolateyBoxstarter \\server\share\script.ps1

This invokes boxstarter and installs the script located at the
specified share.

EXAMPLE

Invoke-ChocolateyBoxstarter win8Install -LocalRepo \\server\share\boxstarter

This installs the Win8Install .nupkg and specifies that it is ok to
reboot the macine if a pending reboot is needed. Boxstarter will look
for the Win8Install .nupkg file in the \\serer\share\boxstarter
directory.

EXAMPLE

Invoke-ChocolateyBoxstarter example -Password (ConvertTo-SecureString "mypassword" -asplaintext -force)

This installs the example package and uses "mypassword" for any reboot
autologins. The user is now not prompted for a password.

LINK

about boxstarter.chocolatey
About the $Boxstarter Variable

Last edited Nov 9, 2013 at 5:00 AM by mwrock, version 7