Powershell

New role, spring cleaning and new modules

Some time ago my team was involved in a reorg (I’ll skip the boring details), the end result is that I am now working on a different (and new) service and I am transitioning to a new role. This seemed a good moment to do some spring cleaning and reorganize my tools/scripts/modules etc… Over the years I have built a good amount of powershell scripts and modules (among other tools), most of them targeted for my and my colleagues specific work and role but I wanted to see if there was some I could instead share to hopefully help someone else.

It took some time, I ended up deleting a number of old scripts no longer relevant (well, I couldn’t really delete them, they are just archived in a private GitHub repo πŸ˜‰) and I have reworked some of my modules and functions into a collection hopefully worth sharing. The result is three new modules you can download either from the Powershell Gallery or from GitHub (and contributions are welcome, should you feel generous enough to open issues or send me a pull request 😊).

PSToolbox (GitHub, Powershell Gallery) is a collection of functions for every day operations, things like converting certificates to and from a Base64 string, format an XML file (who does not like proper indentation? πŸ˜‰), read the encrypted content of a securestring (assuming it was initially encrypted on the same machine), execute sql queries and a few more.

AzToolbox (GitHub, Powershell Gallery) on the other hand is a collection of functions to work with Azure resources. This category of script was the largest I had, unfortunately after cleaning and selecting what could be shared I was left with a much smaller list but it nevertheless contains some useful functions I still use (and I will be adding more). For now the module helps with KeyVault operations (export a certificate, enable/disable certificate autorotation, get expiring certificates), download the latest Az CLI installer and more.

Finally, AzClassicModule (Github, Powershell Gallery) helps to work with classic (RDFE) resources using ARM Resource Providers: in my previous team we were extensively using classic storage accounts and PaaS Cloud Services, both based on the RDFE API. When Powershell 6 came out I wanted to try it (ovbiously) but compatibility with the RDFE modules (specifically with Azure and Azure.Storage) was not great (to use an euphemism) so I decided to search for and build my own alternative, which ultimately lead to this module. Here you can get information about a cloud service, its deployments, role instances, read or update its configuration, vipswap, daa/remove/list certificats and more. With storage accounts there is support for CRUD operations and retrieve the storage keys. Powershell 7 does a much better job at compatibility, but I grew fond of this module over time so I kept using it nevertheless.

Give these modules a try and feel free to open issues on the respective GitHub repos or send me a pull request, let me know what you think, if these are any useful and what other function you would like me to add.


Let your mind alone, and see what happens.Virgil Thomson

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.