Skip to content

Instantly share code, notes, and snippets.

@mwallner
Created February 3, 2020 19:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mwallner/9aeb160877c106aa62b4bd286f4f1d34 to your computer and use it in GitHub Desktop.
Save mwallner/9aeb160877c106aa62b4bd286f4f1d34 to your computer and use it in GitHub Desktop.
using Boxstarter to overcome PowerShell v2 on Box deployments

using Boxstarter to overcome PowerShell v2 on Box deployments

Preparation (on a random host)

  • Install Chocolatey
  • choco install boxstarter -y
  • open "Boxstarter Shell"
  • create "Portable Boxstarter" see wiki
Copy-Item $Boxstarter.BaseDir E:\ -Recurse
E:\BoxstarterDir\Boxstarter example

the fun part

Create a PowerShell script that looks like this (make sure cinst powershell is at the very top, replace the following lines with whatever fits your scenario)

cinst powershell
cinst my-package
cinst another-package
...

now use the "Portable Boxstarter" to execute the created script

E:\BoxstarterDir\Boxstarter.bat <path_to_script.ps1>

and let the magic happen :-). (you probably will be prompted for login credentials needed to overcome neccessary reboots)

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