A function that’s been part of my toolkit for a long time is New-ISOFile by Chris Wu. This excellent little function allowed you to build an ISO file directly from PowerShell, even a bootable one.
I came to use it recently on an automation project with PowerShell 7 and discovered there was some compatibility issue that prevented it from working. I noticed that the original Technet site that the function came from originally is now gone, so I considered this an opportunity for some code review and hopefully produce a revised function that works with PowerShell 7.
A scripting “opportunity” came up this week. Apparently ESXi assigns a virtual (or “shadow”) MAC address to each of its physical adapters, over and above the native physical MAC. The request was to report on all of these MACs across a large number of hosts. Read on to see how this resulted in the Get-esxiShadowMAC function.
Recently, as part of some work to install new physical adapters into our ESXi hosts, I was asked to look at some automation around uplink failover order. If you ever have to change these, it can be somewhat tedious, especially if you have lots of port groups, switches and vCenters.
Since I’ve been slacking on the updates round here, I’ll go over the 2 functions that came out of that piece of work. Hopefully they will save someone else some pain 🙂
I recently did some work with the vRealize Operations Manager REST API using PowerShell. Part of the work was to do with policy export and import, which raised 2 interesting challenges from a PowerShell point of view:
Firstly, HTTP mutlipart form data. We use an HTTP request to send a file to the API, easy on it’s own using the -infile parameter on Invoke-RestMethod, but as soon as you start adding other fields this becomes a bit more involved.
Secondly, the API exports and imports XML policy files in .zip format. Given that this work was part of a CI/CD pipeline in Gitlab, I really didn’t want to be committing .zip files to Git. I also didn’t want to write out files to disk, but rather compress and decompress on the fly as required.
This led to some interesting constructs inside my functions which I thought I would blog about.
This is just a quick post to mention that there’s a new VUMXtra 1.1 module now available. It’s mostly numerous small changes to satisfy my OCD. If I’m being honest, 1.0 was written “at pace” to get something functional and possibly ignored a lot of best practices. Using a bit of downtime over the Christmas break I’ve gone over the code and made some improvements. Read on the find out more…….
Performance tuning, everybody loves that. Maybe you got your car remapped for more power. Maybe you overclocked your CPU for some more GHz. Maybe you want to shave a few milliseconds off your PowerShell execution time but don’t know where to start. Today on The Dot Source, we’ll discuss benchmarking your current code, then looking at some code constructs that will bring those execution times down. Time to take that base model Honda and put $100,000 under the hood.
Anyone who has been asked to automate vSphere Update Manager processes will know that the CMDlets included within PowerCLI are somewhat sparse. The current functionality focuses mainly around patch baselines and not much else. If you want to automate ESXi images, image baselines or baseline groups, you’re out of luck……until now 🙂