VDM30in30 – day 3 – How to get some easy wins with Powershell when provisioning – part 1

powercli

When doing deployments whether they are large or small, you can do them the traditional way; which is building piece by piece from scratch, or you can make your life easier and automate some or all of it. By automating it, you can save time to focus on areas that are more relevant than tedious. It also helps you with standardization, so a build workflow is consistent every time.

One really good tool for this is Powershell. There are many comandlets that help with this and will make your life easier. Here I will talk about powershell comandlets for vSphere and Cisco UCS.

First thing first, install Powershell on a windows machine.

https://technet.microsoft.com/en-us/library/hh847837.aspx

 

Or follow these steps below:


To install Windows PowerShell 3.0

  1. Start Cmd.exe
  2. Run the following DISM commands. These commands install .NET Framework 2.0 and Windows PowerShell 2.0.
    dism /online /enable-feature:NetFx2-ServerCore
    dism /online /enable-feature:MicrosoftWindowsPowerShell
    dism /online /enable-feature:NetFx2-ServerCore-WOW64
    
    
  3. Install Microsoft .NET Framework 4.0 full installation from the Microsoft Download Center at http://go.microsoft.com/fwlink/?LinkID=248450.
  4. Install Windows Management Framework 3.0 from the Microsoft Download Center at http://go.microsoft.com/fwlink/?LinkID=240290.

 

Then install PowerCLI from VMware:

First, from the PowerShell prompt enter:

Set-ExecutionPolicy RemoteSigned

Then, open a command prompt and type the following commands in sequence.
powershell <Enter>
Set-ExecutionPolicy RemoteSigned <Enter>
Exit <Enter>

Download vSphere PowerCLI from the Download page of the VMware Web site and install the vSphere PowerCLI software.

https://my.vmware.com/group/vmware/get-download?downloadGroup=PCLI600R3

Confirm that PowerCLI is working.

Double-click the PowerCLI icon on the desktop to open a PowerCLI window.

A great resource for PowerCLI gems is the PowerCLI cookbook by Phillip Sellers.

Now there are a plethora of things you can do from here that I will get into on the next blog in the series tomorrow.

 

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s