Run Boxstarter Completely Automated / Unattended

Apr 15, 2014 at 2:30 AM
Hello,

First off, I would like to say that this seems like a great tool and I appreciate the work you've done on it. After looking through the documentation and examples, it doesn't seem like there is a way to install and run Boxstarter completely unattended. I was hoping to be able to install the utility as the last stage of deploying a Windows image, and then have it install a bunch of programs from a feed or a meta package on a private repository to create a standardized installation. From everything I've tried so far though, there is always a prompt for a password or a prompt to continue, etc. Before I dig into it too far, I thought I would just see if anyone else has done or attempted this, and if anyone knows if it can be done?

Thanks!

Nate
Coordinator
Apr 15, 2014 at 3:43 AM
Hi Nate,

I apologize that this is difficult to discover. I'm working on adding tutorials to the Boxstarter.org site to make this easier. If I understand what you are trying to do, there are a few ways to accomplish this with no prompts:
  1. Put the put the boxstarter bits on a share or share the directory where they are installed. When you install Boxstarter, from the boxstarter shell you can find the directory to copy to an existing share by running
$Boxstarter.BaseDir
Assuming this is copied to \server\Boxstarter, The machine being provisioned can run this:
$c=Get-Credential SomeAdminUser
Import-Module \\server\boxstarter\boxstarter.chocolatey\boxstarter.chocolatey.psd1
Install-BoxstarterPackage -PackageName yourpackage -Credential $c
By providing a credential, you can avoid the prompt for password.
  1. Install the package remotely. From the Boxstarter shell run:
$c=Get-Credential SomeAdminUser
Install-BoxstarterPackage -ComputerName mycomputer -PackageName yourpackage -Credential $c
This approach requires Powershell remoting to be enabled on the new box.

Do either of these options provide a way forward here?
Apr 15, 2014 at 2:35 PM
Thanks for your reply Matt. Just to clarify, my goal was to have everything automated, launched during/after deploying a Windows image. The remote package install wouldn't really fit because it would be someone manually initiating the install. The first suggestion could possibly work if the credentials were saved so there was no prompt. Maybe by doing something like what is suggested in this article: http://www.interworks.com/blogs/trhymer/2013/07/08/powershell-how-encrypt-and-store-credentials-securely-use-automation-script

I'll try that out. If you have any other suggestions they would be much appreciated!
Coordinator
Apr 15, 2014 at 3:17 PM
Yes. The suggestion in that article, saving a password file, would work. One other thing: if you are confident that your install will not require a reboot on the new machine, you can remove the credential and call:
Install-BoxstarterPackage -ComputerName mycomputer -PackageName yourpackage -DisableReboots
If you pass -DisableReboots, Boxstarter will not prompt for a password or attempt to reboot the machine. It will mean that some install scenarios may possibly fail especially if your package includes windows updates.