Getting started with VMWare PowerCLI

Hi all!

Welcome to my blog. In this post I wanted to show newcomers to VMWare, on how to get started with automating vSphere. I will go through installing the PowerShell module and logging into a vSphere server to start sending commands!

You should ideally have a Windows 10 workstation with PowerShell version 5 or above.

You can check your PowerShell version by typing $PSversiontable.

We need to enable the workstation to allow scripts to run.

Run the "Set-ExecutionPolicy -ExecutionPolicy Unrestricted" command. You need to use good judgment about running scripts, never run a script that you dont understand or know where it came from.







The next step for us to do is check to see if we can reach the internet using PowerShell. Try running the command "Find-Module -Name VMWare.PowerCLI" (without the quotes). You should receive the output similar to the screenshot below.

The "Find-Module" commandlet will attempt to get information about a module across the internet using a trusted repository, in this case the Microsoft PowerShell gallery. You may need to configure a proxy if you are blocked.




To install the module, type "Install-Module -Name VMWare.PowerCLI". You should see PowerShell downloading the package as per the below screenshot.




Finally, to test that the module installed, run "Import-Module -Name VMWare.PowerCLI". If all was done correctly you should see the "Welcome to VMWare PowerCLI!" message and some brief instructions.











This concludes the blog on getting start with VMWare PowerCLI. Next, we will look at logging in and running some simple commands.

Comments

Popular posts from this blog

VM Tools fail to upgrade with vix error 21007

Deploy Multiple VM's with PowerCLI and a vCenter Custom Spec.