Pages

Saturday 29 September 2012

Add VMware to your PowerShell (and Exchange if you want..)

 

  1. Download the necessary PowerCLI software (vSphere PowerCLI: Windows PowerShell interface for managing vSphere): http://communities.vmware.com/community/vmtn/server/vsphere/automationtools/powercli?rct=j&q=&esrc=s&source=web&cd=1&ved=0CCsQFjAA&url=http://www.vmware.com/go/PowerCLI&ei=CSFnUPjcJ-O_0QWwtoDgCA&usg=AFQjCNHixkgPGjBKVx5ZnJKrGXx0ba-y_g
  2. Install
  3. Write the following script, save as a PS1 file and place it in %windir%\system32\WindowsPowerShell\v1.0\ Microsoft.PowerShell_profile.ps1

(Get-Host).ui.rawUI.Foregroundcolor = "green"
(Get-Host).ui.rawUI.Backgroundcolor = "black"
(Get-Host).ui.rawUI.WindowTitle = "The Power of the Shell"
Add-PsSnapin Microsoft.Exchange.Management.PowerShell.Admin -ErrorAction SilentlyContinue
Add-PSSnapin VMware.VimAutomation.Core

 

To test it type cls then get-snapin and you should see the VMware snapin preloaded.

No comments:

Post a Comment