Using Windows Powershell and Chocolatey to quickly setup a new dev desktop environment

I’ve become a huge fan of Chocolatey. I historically have a Linux developer background and I got spoilt by apt so it always had me upset that there was no unified way in Windows of installing and keeping track of various utilities a developer would find useful in day to day life.

I had some experience in Linux shell scripting in my past, but really got into it while building data cleansing scripts using tools like curl, grep and sed for an e-commerce startup I used work for. While I did recognize immediately how powerful mastery of Powershell would offer a Windows developer like myself, it was only in the last year or so I have had the opportunity for field work to hone this (and I am still, by no means, a master of this). I hope soon to have some deeper articles on Powershell, especially now that Powershell Core is maturing and makes it a contender for cross-platform scripting in a manner that may take on the likes of traditional shell scripting shells like bash.

For now though, let’s start at the beginning of any developer’s journey: Getting your dev workstation setup. If you’re anywhere close to my use case, where I use a Mac but spin up new Windows VMs frequently to either isolate different clients’ VPN requirements or keep their streams of work separate, this can be a task in repetition.

Thankfully there’s a simple script I wrote, that eases this into one Powershell script. The initial code I sanitised for release is simple enough to paste in this article, but I plan to update it for more complex developer environment requirements, so you should clone my EasyDevWorkstation Github repository to get these updated scripts later on.

The following lines of script, taken from this repo, when run from an administror-mode Powershell prompt, will do the following:

  1. Set the Execution Policy of the system to RemoteSigned to allow the installation of Chocolatey, and in turn allow Chocolatey scripts to install software
  2. Download and Install Chocolatey
  3. Install via Chocolatey the following
    1. Git, because you need version control from the beginning
    2. Google Chrome browser, because we’re not all Edge and IE fans
    3. The latest available version of Powershell (in case you are running an older OS like Windows Server 2008 R2, Chocolatey I think requires at least one version higher than the base install version)
    4. Visual Studio code, which has been growing in popularity (and extensions) to allow really simple to really powerful scenarios for coding solutions, and has good Git integration
    5. SQL Server Management Studio, because most common developer scenarios require connecting to SQL Server databases at some point.

Here’s the script:

Set-ExecutionPolicy RemoteSigned
iwr -UseBasicParsing | iex
choco install -y --allow-empty-checksums git GoogleChrome powershell visualstudiocode sql-server-management-studio

Full screen mode Windows 10 tip in Parallels for Mac

I love my Macbook Pro, but I’m a Windows developer by profession, so marrying the two worlds required I make use of tools like Parallels for Mac, which easily allows me to integrate Windows 10 into my Mac OSX experience thru Coherence mode. At a reasonable subscription cost, it’s the best option for independent developers like myself who don’t have an Enterprise budget.

However sometimes you want that full screen Windows experience to focus for a bit.

That’s when you realise Full screen mode Windows 10 using Parallels for Mac is an awesome feature. It almost makes me forget I’m on an Apple device. Until I’m ready to go back to OSX, and then I’m stuck. How do I exit this full screen mode if there’s no Apple window title button to click to exit?

The answer is simple, press Ctrl+Command+F to activate the shortcut key combination for both entering and exitting Full Screen mode with Parallels for Mac.

Thank Google and this reference article for the information 🙂

Basics of getting connected to Office 365 Powershell

I’m setting up a new laptop for Office 365 administration and development work, and in doing so I realised sometimes I forgot the basics to getting Office 365 Powershell commands available once again. As a reminder they are:

  1. Install the Microsoft Online Services Sign-in Assistant for IT Professionals
  2. Install the Azure Administration MSI from the Azure Active Directory Connection page
  3. Run the “Azure Active Directory Module for Microsoft Powershell” and test that it all works with a Get-MsolUser command after logging in to your Office 365 tenant with the Connect-MsolService command

I purposely didn’t put any links here to the downloads, since its much more detailed and well written on the Microsoft TechNet article on Office 365 Powershell setup so I’d highly recommend reading that as your guide if you’re doing this for the first time.