I’ve reached a stumbling point in my PowerShell development for automating ESXi/vCenter customisation. In a bid to leave out any hard-coded localised details from the scripts, by using CSV files, I’m stuck producing a list of clusters for the admin running the script to pick from. The cluster details are in a CSV and I’ve used a foreach loop to pull out the names of the clusters, presenting them to the admin one by one in a numbered list. Prior to this, I hard-coded the list and used a switch process to set a variable for the selected cluster. I’m not sure how I can do this having used a foreach loop to pull CSV content, or if there is a better solution completely!
Could really use some help please!