save time with powercli

34
How To Save Your Time With PowerCLI Jonathan Medd

Upload: jonathanmedd

Post on 24-May-2015

2.273 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Save Time With PowerCLI

How To Save Your Time With PowerCLIJonathan Medd

Page 2: Save Time With PowerCLI
Page 3: Save Time With PowerCLI

Pick the right management tool for you or the situation

Page 4: Save Time With PowerCLI

Do You Manage Any Of These Technologies?

Page 5: Save Time With PowerCLI
Page 6: Save Time With PowerCLI
Page 7: Save Time With PowerCLI
Page 8: Save Time With PowerCLI
Page 9: Save Time With PowerCLI

Write your own script or function help, for you or someone else

They will thank you, and you will be pleased one day that you did it too

Page 10: Save Time With PowerCLI

Help Demo

Page 11: Save Time With PowerCLI
Page 12: Save Time With PowerCLI

Digitally Sign Your Scripts

Save time and costly mistakes by helping prevent unauthorised changesMost IDEs will sign the script for you

Page 13: Save Time With PowerCLI

Be Green, Create Advanced Functions as Reusable Code

Page 14: Save Time With PowerCLI

Advanced Functions - Features

•Add –Confirm, -WhatIf capabilities•Parameter Attributes• Mandatory, Parameter Sets, Accept Pipeline Input, Help Message, Validation

Page 15: Save Time With PowerCLI

Advanced Functions - Demo

Page 16: Save Time With PowerCLI

Competition Time – PowerCLI Book Giveaway Where is PowerCLI Guru Alan Renouf originally from?

• France

• Netherlands

• Jersey

• Outer Space

Page 17: Save Time With PowerCLI

Modules Make Distributing Your Code EasierVS

Page 18: Save Time With PowerCLI

What is a PowerShell Module?

• A collection of files containing functions, scripts etc and possibly other files such as the manifest to make it more professional

• Stored within a folder as a subfolder of the Modules location. Can be found via $env:PSModulePath

• Contents made accessible to the user via the Import-Module cmdlet

Page 19: Save Time With PowerCLI

Why Bother with a PowerShell Module?

• Makes sharing of groups of functions and scripts easy• Simple XCOPY style deployment of the module folder either internally or

publishing to an external website• Make your commonly used functions available to yourself without ‘Profile

Bloat’ – they are available as and when you need them from a module

Page 20: Save Time With PowerCLI

Make Your First Module

• Create two functions• Save them into a *.psm1 file to the module

folder• Import them for use into your session• Go!

Page 21: Save Time With PowerCLI

Make Your First Module - Demo

Page 22: Save Time With PowerCLI

PowerCLIBook Module - Demo

Page 23: Save Time With PowerCLI
Page 24: Save Time With PowerCLI

If you borrow it, make sure you test it!

Share back your own scripts / solutions. You know how good it was when you found something useful, give someone else that same experience.

Page 25: Save Time With PowerCLI

Good places to start borrowing

Virtu-Al.netLucD.infoVMware PowerCLI Community Site

Page 26: Save Time With PowerCLI

Borrowed Examples

Page 27: Save Time With PowerCLI

PowerGUI VMware PowerPack

Page 28: Save Time With PowerCLI

Use in combination with VMware Community PowerPack to kick start your PowerCLI scripting

Page 29: Save Time With PowerCLI

PowerGUI Quick Overview

Page 30: Save Time With PowerCLI
Page 31: Save Time With PowerCLI

Automate Deployment of ESXi

At a minimum use PowerCLI to create a standard host config

For bonus points use additional technologies to automate further:• Kickstart• Host Profiles• AutoDeploy

Page 32: Save Time With PowerCLI

In Jeffrey We Trust

Page 33: Save Time With PowerCLI
Page 34: Save Time With PowerCLI