Boxstarter setup script for setting up a customized windows environment in a completely unattended manner using PowerShell and Chocolatey packages.
Open an elevated PowerShell console and run the following command:
PS > Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/gennesseaux/boxstarter/master/boxstarter.ps1' -OutFile "$($env:temp)\boxstarter.ps1"; &Invoke-Command -ScriptBlock { &"$($env:temp)\boxstarter.ps1" -profiles @('<Profile>') -options @('<Option>') }
I have setup different profile which can be installed separately or not. For the full list, look in the profile folder.
However, if you want to launch your own script (from gist) and take benefit of my premade function then run the following command
PS > Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/gennesseaux/boxstarter/master/boxstarter.ps1' -OutFile "$($env:temp)\boxstarter.ps1"; &Invoke-Command -ScriptBlock { &"$($env:temp)\boxstarter.ps1" -Scripts @('<YourScript>') }
- Deploy the Essential profile.
PS > Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/gennesseaux/boxstarter/master/boxstarter.ps1' -OutFile "$($env:temp)\boxstarter.ps1"; &Invoke-Command -ScriptBlock { &"$($env:temp)\boxstarter.ps1" -profiles @('Essential') }
- Deploy the Essential profile without windows updates.
PS > Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/gennesseaux/boxstarter/master/boxstarter.ps1' -OutFile "$($env:temp)\boxstarter.ps1"; &Invoke-Command -ScriptBlock { &"$($env:temp)\boxstarter.ps1" -profiles @('Essential') -options @('Boxstarter::WindowsUpdate=false') }
- Deploy the Essential and DevCore profiles without windows updates and visual studio code default extentensions.
PS > Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/gennesseaux/boxstarter/master/boxstarter.ps1' -OutFile "$($env:temp)\boxstarter.ps1"; &Invoke-Command -ScriptBlock { &"$($env:temp)\boxstarter.ps1" -profiles @('Essential', 'DevCore') -options @('Boxstarter::WindowsUpdate=false', 'Boxstarter::DevCore::VisualStudioCodeExtensions=false') }
- Deploy your own boxstarter script.
PS > Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/gennesseaux/boxstarter/master/boxstarter.ps1' -OutFile "$($env:temp)\boxstarter.ps1"; &Invoke-Command -ScriptBlock { &"$($env:temp)\boxstarter.ps1" -Scripts @('https://raw.githubusercontent.com/gennesseaux/boxstarter/master/example/gist/MyGist.ps1') }
If you are behind a proxy, you may be unable to execute boxstarter.
Then you have few options to get it working:
- Using default proxy credential
PS > $webclient = New-Object System.Net.WebClient
PS > $webclient.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
PS > wget -Uri 'https://raw.githubusercontent.com/gennesseaux/boxstarter/master/boxstarter.ps1' -OutFile "$($env:temp)\boxstarter.ps1";&Invoke-Command -ScriptBlock { &"$($env:temp)\boxstarter.ps1" -profiles @('<Profile>') -options @('<Option>') }
- Using basic authentication
PS > $user = "Domaine\username"
PS > $pass= "password"
PS > $headers = @{ Authorization = "Basic {0}" -f [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $($user),$($pass)))) }
PS > wget -Uri 'https://raw.githubusercontent.com/gennesseaux/boxstarter/master/boxstarter.ps1' -Headers $headers -OutFile "$($env:temp)\boxstarter.ps1";&Invoke-Command -ScriptBlock { &"$($env:temp)\boxstarter.ps1" -profiles @('<Profile>') -options @('<Option>') }
- Using credential
PS > $user = "Domaine\username"
PS > $pass= "password"
PS > $credential = New-Object System.Management.Automation.PSCredential($user, (ConvertTo-SecureString $pass -AsPlainText -Force))
PS > wget -Uri 'https://raw.githubusercontent.com/gennesseaux/boxstarter/master/boxstarter.ps1' -Credential $credential -OutFile "$($env:temp)\boxstarter.ps1";&Invoke-Command -ScriptBlock { &"$($env:temp)\boxstarter.ps1" -profiles @('<Profile>') -options @('<Option>') }
- Using proxy credential
PS > $user = "Domaine\username"
PS > $pass= "password"
PS > $credential = New-Object System.Management.Automation.PSCredential($user, (ConvertTo-SecureString $pass -AsPlainText -Force))
PS > $webclient = New-Object System.Net.WebClient
PS > $webclient.Proxy.Credentials = $credential
PS > wget -Uri 'https://raw.githubusercontent.com/gennesseaux/boxstarter/master/boxstarter.ps1' -OutFile "$($env:temp)\boxstarter.ps1";&Invoke-Command -ScriptBlock { &"$($env:temp)\boxstarter.ps1" -profiles @('<Profile>') -options @('<Option>') }
- Defining your proxy settings
PS > $user="Domaine\username"
PS > $pass="password"
PS > $webProxy = New-Object System.Net.WebProxy("http://your.webproxy:8080",$true)
PS > $webclient = New-Object System.Net.webclient
PS > $webclient.Proxy=$webproxy
PS > $webclient.proxy.Credentials = New-Object System.Net.NetworkCredential($user, $pass)
PS > wget -Uri 'https://raw.githubusercontent.com/gennesseaux/boxstarter/master/boxstarter.ps1' -OutFile "$($env:temp)\boxstarter.ps1";&Invoke-Command -ScriptBlock { &"$($env:temp)\boxstarter.ps1" -profiles @('<Profile>') -options @('<Option>') }
Look at the scripts in the example folder to find real examples.