Skip to content

Instantly share code, notes, and snippets.

@Jickelsen
Last active July 5, 2018 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jickelsen/72a626f45eeb684e647985e9c80ea105 to your computer and use it in GitHub Desktop.
Save Jickelsen/72a626f45eeb684e647985e9c80ea105 to your computer and use it in GitHub Desktop.
######## Jickel's devboxstarter script ########
###############
#### notes ####
###############
# Test-Admin is not available yet, so use...
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
Start-Process powershell -ArgumentList "-noprofile -NoExit -file `"$PSCommandPath`"" -Verb RunAs
Exit
}
# http://boxstarter.org/InstallBoxstarter
# Installing from the web
# From a Administrator PowerShell, if Get-ExecutionPolicy returns Restricted, run:
if ((Get-ExecutionPolicy) -eq "Restricted") {
Set-ExecutionPolicy Unrestricted -Force
}
$_boxstarter_path = 'C:\ProgramData\Boxstarter\BoxstarterShell.ps1'
if (!(Test-Path $_boxstarter_path)) {
. { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
}
# Then run: Boxstarter Shell as an Administrator
$cwd = "$(Get-Location)"
. $_boxstarter_path
cd "$cwd"
# Copy: Microsoft.PowerShell_profile.ps1 file to $env:userprofile\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
# To install, run from Adinistrator: Boxstarter shell
# C:\path\to\this\file\boxstarter.ps1
# Or, open up a PowerShell as Administrator, and run:
# START http://boxstarter.org/package/nr/url?https://gist.github.com/jeebak/8064d35757c99b0cd507
# Logs: C:\ProgramData\chocolatey\logs\chocolatey.log
# Boxstarter options
$Boxstarter.RebootOk=$true # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
$Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot
###############################
#### Windows Configuration ####
###############################
# Configure Windows (Boxstarter.WinConfig cmdlets)
Set-WindowsExplorerOptions `
-EnableShowHiddenFilesFoldersDrives `
-EnableShowProtectedOSFiles `
-EnableShowFileExtensions `
Update-ExecutionPolicy Unrestricted
# Install chocolatey
if (!(Test-Path 'C:\ProgramData\chocolatey\bin\choco.exe')) {
iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
}
# test for this (choco list --source windowsfeatures)
cinst -y Microsoft-Hyper-V-All -source windowsFeatures
##########################
#### Custom Functions ####
##########################
# Seed an associative array of all locally installed chocolatey packages
$_installed_packages = @{}
choco list --limitoutput --localonly | % {
$line = $_.split('|')
$_installed_packages[$line[0].ToLower()] = $line[1]
}
function _cinst {
param([string] $package)
if (!$_installed_packages[$package.ToLower()]) {
Write-Host "Installing: $package"
cinst -y "$package"
}
else {
Write-Host "Already installed: $package"
}
}
######################
#### dependencies ####
######################
## nothing right now
#########################
#### requires reboot ####
#########################
_cinst googlechrome -y
_cinst firefox
# _cinst visualstudio2017community
if (Test-PendingReboot) { Invoke-Reboot }
#######################
#### general utils ####
#######################
_cinst lastpass
_cinst filezilla
_cinst windirstat
_cinst sharpkeys
_cinst handbrake
_cinst paint.net
_cinst postman
_cinst autohotkey.install
if (Test-PendingReboot) { Invoke-Reboot }
###################
#### dev utils ####
###################
_cinst cmder
_cinst git-credential-manager-for-windows
_cinst jdk8
if (Test-PendingReboot) { Invoke-Reboot }
##################
#### dev apps ####
##################
_cinst androidstudio
## includes SDK
_cinst vscode
_cinst curl
_cinst wget
_cinst unity
_cinst unity-android
if (Test-PendingReboot) { Invoke-Reboot }
#################
#### cleanup ####
#################
# del C:\eula*.txt
# del C:\install.*
# del C:\vcredist.*
# del C:\vc_red.*
########################
#### other installs ####
########################
_cinst nextcloud-client
cinst -y --ignorechecksum spotify
_cinst mpc-hc
_cinst vlc
_cinst steam
_cinst slack
_cinst discord
if (Test-PendingReboot) { Invoke-Reboot }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment