After messing with my Hosts File Updater script, I decided it needed an update. We’ve been messing with WPF and Powershell for a while now, and this would make the perfect candidate to showcase some WPF and runspaces.
We’ve recently been toying around with building a GUI for some of our web deployment functions, and naturally the project evolved over time. It started with building a UI in WPF, evolved to runspaces for performance gains, and finally ended at runspace pools for throttling. Through these evolutions, I’ve gained a considerable amount of knowledge in what can be done with Powershell.
I was going through and adding some formatting to a Powershell script that I had recently rewritten, when it started throwing errors without a single code change.
While updating our Windows 10 images to the anniversary update (1607), I noticed that all the bloat I had already removed was added back. So I took this opportunity to brush up on some more Powershell and create a script that could help some other folks with the same issue!
This script has found itself being used for many other purposes than originally intended, not sure why it has taken me so long to post it! It was written to provide for an easy way to zip all of our IIS logs, and have them grouped by month created. It was originally setup to append .zip files with new data as needed but ,due to a bug in the write-zip cmdlet, I have changed it to ignore the last month of logs. I will leave the commented out code in this script, just in case they eventually fix the bug.
As part of our deployment process, we make a backup of our sites. This is to ensure that we can restore quickly should something go wrong without having to roll to our disaster recovery process. As part of writing this script, we wanted to make sure that we only kept the latest 3 backups. This script was meant to be daisy chained with others in our push process, I’ve left those check in place as someone might find them useful for their own scripting.
Our employee termination process involves several steps. While they don’t take too long to run through individually, time IS precious! Here is a script that I wrote to automate the majority of the tasks that we perform when someone chooses to leave RANDA. There’s even a fun “Finished” notification to make the painful process of someone leaving a bit more light hearted.