PowerCLI Get-vCenter Function

Since I work in a multiple vCenter environment, it is nice to have a function that allows for a connection choice when running a PowerCLI script.  The Get-vCenter function has an array of all the vCenters I potentially might connect with to run a PowerCLI script.  This array is presented in a numbered format that allows the script user to choose the vCenter they want to use for the rest of the script. You can make the array as large or small as you want.  It will dynamically create a numbered choice next to each vCenter.  It is simple but comes in very handy.

Caution: Like all code you download from the internet, please understand and modify the code accordingly to prevent unforeseen production problems.  Also known as career-altering events. 

PowerCLI Code:

Advertisements

Unleash your formidable comments