Building a VM script using all the pieces

Consider the following parameters:

  • Premise: Create a script that will prompt a user for information to build a new VM
  • Inputs: This includes vCPUs, memory, datacenter, DRS cluster, valid datastore, Resource Pool, VM folder, customization specification, and data disk size
  • Outputs: These are freshly built VM to specs
  • Assumptions: Data gathering will be done on valid information from the virtual environment itself; no hard coded information will be valid unless specified in the script to the user (for example, the OS disk size)
  • Script: Consider the following code snippet:
    Connect-vCenter.ps1 <# .Synopsis Does the lifting of connecting to a vCenter .Description Starts VIMAutomation Module Gets Credentials Gets the ...

Get PowerCLI Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.