How to make your PowerShell scripts look better

When I started writing my first PowerShell scripts... They didn't look that good, it was PowerShell 2.0 of course and I was just a beginner 🙂 I'm getting better at it and the newer versions of PowerShell (And Visual Studio Code) have a few nice formatting tricks. This blogpost will show you a few ways to make your scripts look better and more importantly... A lot more readable!

Start Windows Sandbox with parameters

Personally I use Windows Sandbox a lot for testing Endpoint Manager packages or software, sometimes you want to start it with certain options (Connect a folder on your harddrive or start without a network connection) and you have to create a custom configuration file (.wsb) with those options. This blogpost shows you how to start Windows Sandbox using PowerShell with parameters without the need of creating multiple configuration files.

Scripts from my blogs are available on GitHub now

All the scripts that I used in my blogposts are availabe on GitHub now 🙂 All new items will apear there too. You can download them individually or clone my repository to your harddrive. (How to Clone) The GitHub URL is https://github.com/HarmVeenstra/Powershellisfun . I also added the URL on each blogpost page at the end so that you can jump straight away to the correct folder.

Retrieve Email DNS records using PowerShell

I have been doing a lot of Exchange on-prem to Exchange Online migrations the last few years, because of that I use mxtoolbox.com a lot for querying of MX, SPF, DMARC and DKIM records. Wouldn't it be convenient to get a simple overview of those records in a PowerShell function? This blogpost will show you how 🙂

Get WHOIS information using PowerShell

The last few days I was working on an issue that involved getting an overview of the networks being used and the public ip-adresses. Because I was not sure if the public ip-adresses in some logs were from that company, I had to lookup a lot of IP's manually using Ripe/Whois sites. This blogpost shows you a way in which you can get details for your own Public IP or the ip-address or domain name that you specify.

Copy Exchange Receive Connector Settings using PowerShell

Currently working on rebuilding a failed Exchange 2016 DAG node, installing Exchange and getting the databases in sync again... And then you remember that the Anonymous Relay settings is something that's configured on each node seperately and it contains a lot of ip-addresses 🙁 This blogpost shows you a way to copy an existing Receive Connector to a new Exchange server easily!