First Steps with PowerCLI

 

When starting to use PowerCLI 5.0.1 for the first time, there are a few things that will help you start off a good foot. I for one, have decided when installing the PowerCLI on my system to modify the installation to add the vCloud Director PowerCLI feature and to change the path of installation, so that I can quickly find my .PS1 on my development machine.

Installing PowerCLI 5.0.1 Build 4431

Selecting vCloud Director PowerCLI feature & changing install Path

Once installed on my development machine, I add start the PowerCLI to my taskbar and start it. I then modify the Layout settings to get a better usable window.

Modifying PowerCLI Layout

And now we are getting to the two basic commands you add to your PowerCLI to ensure you can run RemoteSigned code.

[box] set-ExecutionPolicy RemoteSigned[/box]

Set-ExecutionPolicy RemoteSigned

As I’m developping my code on a system other than the vCenter Server. I will get SSL Certificates warnings if I remotely connect to my vCenter. To ignore the Certificate warnings I use to following command

[box] Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -WarningAction SilentlyContinue[/box]

Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -WarningAction SilentlyContinue

When connecting to my vCenter I now only get a pop-uo for the User Credentials.

Connect-VIServer will request Credentials

I can also save my credentials for future use.

Connect-VIServer with Credentials saving

And so the next time I don’t even need to re-enter these credentials.

Connect-VIServer using saved Credentials