Azure Spills and Cleanups

UPDATED 11/09/2016 @11:39 PM EST

It’s 2:55 AM and I’m about to crash. Been writing and testing PowerShell code to automate some interesting Azure environment builds. In the process of building, testing, tearing down and repeating, I needed a quick way to reset or “clean” my Azure subscription between runs.

This requires me to keep one resource group (yes, this is ARM related) from being wiped out, because it houses some template VHD’s and so on. Anyhow, this code works from PowerShell ISE best (because ISE, unlike the regular PS console, maintains the credential object in memory during each session). Anyhow, I thought you might find it useful if you don’t already have a better option… cheers!