Configure VMTools Repo
Need to update VMware Tools on your VMs?
There are lots of ways to do this but I like to use the built-in tools. If you use the built-in update checker, you need to have the latest version in the ESXi hosts tools repository. By default, this is baked into the host installed image in each host. This script will change that to a shared location on a datastore and folder of your choosing.
Once again, we connect ot vCenter, like always. Then we get a list of datastores, and this is where it gets fancy! We display that list using Out-GridView -PassThru so you can make a selection and click OK. With the datastore selected, we get a list of top level folders and make a selection using the same Out-GridView -PassThru. With a path (hopefully) selected, we display the old path for kicks and update to the new path.
What makes this ugly?
No input validation... Starting to see a theme here?
Still not a reusable function.
No sanity checks, it just assumes that you make proper selections.
vCenter address is hard coded.
Something like this really should be a function and use ShouldProcess to give you a chance to back out before making potentially undesired changes.