In this blog post, I am going to break down a PowerShell code I have created (with help from some colleagues). The functions of this PowerShell code are;
- Present a GUI form to the end user
- Connect to a vCenter
- Select the virtual machine to be cloned
- Select the datastore the new VM is to be stored on (display DS free space)
- Select the host for this VM to be created against (display free memory on the host)
- Set the new VM name
- Create an IP reservation in both the Production and DR DHCP Scopes
Below are some functional screenshots of the code’s GUI and also a rough flowchart of what I needed to achieve.
You can skip to the end to find the full code.