How to fix Try Catch not working with PowerCLI cmdlets

I’ve been working on a project that entails deploying VMs in large numbers. Due to this there obviously needs to be great error handling, as I started to build our modules for deploying systems I noticed that powershells try catch was not working as expected. The code would enter into the try block and execute, […] Read More

0 comments

Returning multiple values from a PowerShell function

Returning multiple values in a powershell function is something that took me an embarrassing amount of time to figure out. Its not documented all that well and there are very few blog posts on the topic. It turns out there are a few ways to do this but I keep falling back to using hashtables, […] Read More

0 comments

Moving ZeleskiTech to TLS encryption

Its about time! I’ve finally moved my site over to TLS encryption. Some might say its not necessary for a blog site like this but I personally think its a great idea for all websites regardless of the content displayed. Im using CloudFlare’s Full encryption configuration and so far its worked perfectly. There are good […] Read More

0 comments

How to import PowerCLI powershell modules/snapin and connect to vCenter

Opening the PowerCLI shortcut just to run a script gets a bit old when you basically live in it. I have scripts that I can open to do simple tasks like changing network adapters or adding a HDD, usually you would have to open the PowerCLI window and then cd to the directory where your […] Read More

0 comments

Detecting what version of PowerShell is currently installed

During automation there will be a time where are specific powershell version will be required. In order to properly detect this you must use the following object: “$PSVersionTable.PSVersion” DO NOT use $Host.Version and (Get-Host).Version as they show the host version not the engine version. Here is a quick example of how to use this in […] Read More

0 comments