Add all Virtual Machines in a DataStore to vCenter Inventory

here are situations when you have VMs on disk, but vCenter does not know about them – i.e. they are not in the inventory. While it is fairly easy to add a single machine to the inventory, doing so for dozens or hundreds or VMs is too tedious to do manually. This script automates the process.