Skip to content

Instantly share code, notes, and snippets.

@mikesigs
Last active July 6, 2018 18:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mikesigs/d6d0f4c854e9a0e352a7 to your computer and use it in GitHub Desktop.
Save mikesigs/d6d0f4c854e9a0e352a7 to your computer and use it in GitHub Desktop.
Developer Machine Setup using BoxStarter
if (Test-PendingReboot) { Write-Warning "mikesigs - Reboot pending right from the start!" }
$GitUserName='Mike Sigsworth'
$GitUserEmail='mikesigsworth@gmail.com'
# 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
Update-ExecutionPolicy Unrestricted
if (Test-PendingReboot) { Write-Warning "mikesigs - Reboot pending after update-executionpolicy" }
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
if (Test-PendingReboot) { Write-Warning "mikesigs - Reboot pending after setting explorer options" }
Disable-InternetExplorerESC
if (Test-PendingReboot) { Write-Warning "mikesigs - Reboot pending after disabling IE ESC" }
if (Test-PendingReboot) { Write-Warning "mikesigs - Reboot pending before UAC change..." }
Disable-UAC
if (Test-PendingReboot) { Write-Warning "mikesigs - Reboot pending after UAC change..." }
# DotNet Runtime
#cinst dotnet3.5
#cinst dotnet4.6.1
# Chocolatey Installs
#chocolatey feature enable -n=allowGlobalConfirmation
chocolatey feature enable -n=allowEmptyChecksums
#cinst 7zip.commandline -y
#cinst 7zip.install -y
#cinst cmder -y
#cinst diffmerge -y
#cinst expresso -y
#cinst firefox -y
cinst git -params '"/GitAndUnixToolsOnPath"' -y
#cinst gittfs -y
#cinst googlechrome -y
#cinst hxd -y
cinst linqpad -y
#cinst lockhunter -y
#cinst nvm -y #Sadly there is no nvm package... yet. But I handle the install later in this script
#cinst notepadplusplus -y
#cinst notepadplusplus.commandline -y
#cinst nuget.commandline -y
cinst paint.net -y
#cinst papercut -y
#cinst python2 -y
#cinst resharper-platform -y
#cinst slack
#cinst sourcetree -y
cinst sysinternals -y
#cinst tightvnc -y -installarguments '"ADDLOCAL=Viewer"'
cinst virtualclonedrive -y
#Install-ChocolateyPinnedTaskBarItem "${env:ProgramFiles(x86)}\Google\Chrome\Application\chrome.exe"
#chocolatey feature disable -n=allowGlobalConfirmation
chocolatey feature disable -n=allowEmptyChecksums
$GitUserName='Mike Sigsworth'
$GitUserEmail='mikesigsworth@hotmail.com'
# git Configuration
git config --global --replace-all user.name $GitUserName
git config --global --replace-all user.email $GitUserEmail
git config --global --replace-all alias.tfspush 'tfs rcheckin'
git config --global --replace-all alias.tfspull 'tfs pull -r'
git config --global --replace-all alias.scorch 'clean -xdie *.suo'
git config --global --replace-all alias.singe 'clean -die *.suo'
git config --global --replace-all alias.hist 'log --pretty=format:''%Cred%h%Creset %Cgreen(%ad)%Creset %s %C(bold blue)[%an]%Creset%C(yellow)%d%Creset'' --date=format:''%b %d %H:%M'' --abbrev-commit --graph'
git config --global --replace-all alias.addall 'add -A :/'
git config --global --replace-all alias.fixignore 'rm -r --cached .'
git config --global --replace-all diff.tool diffmerge
git config --global --replace-all difftool.diffmerge.cmd '''C:\Program Files\SourceGear\Common\DiffMerge\sgdm.exe'' \"$LOCAL\" \"$REMOTE\"'
git config --global --replace-all difftool.sourcetree.cmd '''C:\Program Files\SourceGear\Common\DiffMerge\sgdm.exe'' \"$LOCAL\" \"$REMOTE\"'
git config --global --replace-all merge.tool diffmerge
git config --global --replace-all mergetool.diffmerge.cmd '''C:\Program Files\SourceGear\Common\DiffMerge\sgdm.exe'' -merge -result=\"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\"'
git config --global --replace-all mergetool.diffmerge.trustExitCode true
git config --global --replace-all mergetool.sourcetree.cmd '''C:\Program Files\SourceGear\Common\DiffMerge\sgdm.exe'' -merge -result=\"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\"'
git config --global --replace-all mergetool.sourcetree.trustExitCode true
git config --global --replace-all core.preloadindex true
git config --global --replace-all core.editor 'notepad++'
git config --global --replace-all core.autocrlf true
git config --global --replace-all filter.lfs.clean 'git-lfs clean %f'
git config --global --replace-all filter.lfs.smudge 'git-lfs smudge %f'
git config --global --replace-all filter.lfs.required true
git config --global --replace-all credential.helper '"%appdata%\GitCredStore\git-credential-winstore.exe"'
# Install nodejs via nvm-windows
$NpmEmail='mikesigsworth@hotmail.com'
curl -LOk https://github.com/coreybutler/nvm-windows/releases/download/1.1.0/nvm-setup.zip
7z e nvm-setup.zip
nvm-setup.exe
nvm install 4.2.5
nvm use 4.2.5
npm -g update npm
npm config set loglevel http
npm config set spin false
npm config set msvs_version 2015
npm config set email $NpmEmail
# Please install Visual Studio manually before running this script. I know there's a way to do it silently, but I ain't spendin the time to figure it out right now
Install-ChocolateyVsixPackage "Indent Guides" https://visualstudiogallery.msdn.microsoft.com/e792686d-542b-474a-8c55-630980e72c30/file/48932/20/IndentGuide%20v14.vsix
Install-ChocolateyVsixPackage "Productivity Power Tools 2015" https://visualstudiogallery.msdn.microsoft.com/34ebc6a2-2777-421d-8914-e29c1dfa7f5d/file/169971/1/ProPowerTools.vsix
Install-ChocolateyVsixPackage "Web Essentials 2015" https://visualstudiogallery.msdn.microsoft.com/ee6e6d8c-c837-41fb-886a-6b50ae2d06a2
Install-ChocolateyVsixPackage "VSCommands 14 for Visual Studio 2015" https://visualstudiogallery.msdn.microsoft.com/c84be782-b1f1-4f6b-85bb-945ebc852aa1
Install-ChocolateyPinnedTaskBarItem "${env:ProgramFiles(x86)}\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe"
@mikesigs
Copy link
Author

Update your git aliases to include some of these new ones.

    tfspush = tfs rcheckin
    tfspull = tfs pull -r
    scorch = clean -xdie *.suo
    singe = clean -die *.suo
    hist = log --pretty=format:'%Cred%h%Creset %Cgreen(%ad)%Creset %s %C(bold blue)[%an]%Creset%C(yellow)%d%Creset' --date=format:'%b %d %H:%M' --abbrev-commit --graph
    addall = add -A :/
    fixignore = rm -r --cached .
    amend = commit --amend --no-edit

    #Source and usage: http://haacked.com/archive/2014/07/28/github-flow-aliases/
    co = checkout
    ec = config --global -e
    up = !git pull --rebase --prune $@ && git submodule update --init --recursive
    cob = checkout -b
    cm = !git add -A && git commit -m
    save = !git add -A && git commit -m 'SAVEPOINT'
    wip = !git add -u && git commit -m "WIP" 
    undo = reset HEAD~1 --mixed
    wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
    bclean = "!f() { git branch --merged ${1-master} | grep -v " ${1-master}$" | xargs -r git branch -d; }; f"
    bdone = "!f() { git checkout ${1-master} && git up && git bclean ${1-master}; }; f"

    # Source and usage: http://haacked.com/archive/2015/06/29/git-migrate/
    migrate = "!f(){ CURRENT=$(git symbolic-ref --short HEAD); git checkout -b $1 && git branch --force $CURRENT ${3-'$CURRENT@{u}'} && git rebase --onto ${2-master} $CURRENT; }; f"

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