HTTP Multipart Forms and on the Fly Compression in PowerShell.

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.

Continue reading “HTTP Multipart Forms and on the Fly Compression in PowerShell.”

VUMXtra 1.1 Update

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…….

Continue reading “VUMXtra 1.1 Update”

PowerShell Performance Tuning

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.

Continue reading “PowerShell Performance Tuning”

VUM Xtra Module: Extended VUM Automation with the VC Integrity API

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 🙂

Continue reading “VUM Xtra Module: Extended VUM Automation with the VC Integrity API”