Invoke-Boxstarter

SYNOPSIS

Invokes the Boxstarter bootstrapper

SYNTAX

Invoke-BoxStarter [-ScriptToCall <ScriptBlock>] [-password
<SecureString>] -RebootOk <CommonParameters> [-NoNewWindow <Switch>]

DESCRIPTION

This wraps any powershell script block and executes it in an environment tailored for uninterrupted installations
  • Turns off the 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
  • 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
If the password argument is not included and RebootOk is passed,
the user will be prompted for a password immediately after
invoking the command and that password will be used for any
subsequent reboot during the boxstarter run.

Parameter

ScriptToCall

The script that boxstarter wraps. After Boxstarter Shuts down
the update services and ensures that the console is running as
admin, it invokes this script. The script may call Invoke-Reboot
at any time and Boxstarter will ensure that the machine is
rebooted, loged in and the script is rerun.

Password

This password will be used to automatically log the user in if a
reboot is required and reboots are eabled.

RebootOk

If set, a reboot will be performed if boxstarter determines that a
reboot is pending. If no password is supplied t othe Password
parameterBoxstarter will prompt the user to enter a password which
will be used for automatic logins in the event a restart is
required.

NoNewWindow

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.

EXAMPLE

Invoke-Boxstarter {Import-Modler myinstaller;Invoke-MyInstall} -RebootOk
This invokes boxstarter and iinvokes MyInstall. 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.

LINK

about the $boxstarter variable in bootstrapper
about boxstarter.bootstrapper
Invoke-Reboot

Last edited Aug 4, 2013 at 4:15 PM by mwrock, version 2