Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
PowerCLI Essentials

You're reading from   PowerCLI Essentials Simplify and automate server administration tasks with PowerCLI

Arrow left icon
Product type Paperback
Published in Apr 2016
Publisher Packt
ISBN-13 9781785881770
Length 194 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Chris Halverson Chris Halverson
Author Profile Icon Chris Halverson
Chris Halverson
Arrow right icon
View More author details
Toc

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 vCenter name and connects to vCenter
    .Input
        User Input
            Credentials
            vCenter Name
    .Output
        None
    .Author
        Chris Halverson
    .Change Log
        11/6/2015
    .FileName
        Connect-vCenter.ps1
    .Version
        Draft 0.1...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime