How to integrate PowerCLI with PowerShell and PowerShell ISE

I wrote a post about how to integrate PowerCLI with PowerShell manually. I rebuilt my computer few days ago, need to integrate PowerCLI again. I used to scripting by PowerGUI, but something always lead to PowerGUI lost menu, it frustrated me a long time. I cannot figured out what’s the root cause. So I wondered is it possible use PowerShell ISE instead of PowerGUI?

What I need is simple, just gives me full command when press TAB key so I don’t have to remember every command. I found a good article show how to add PowerCLI to PowerShell ISE.

Anyhow I love more simpler, so I used command lines below to integrate PowerCLI with PowerShell and PowerShell ISE. Hope it’s helpful for you.

Step1. Make sure the return of following command is “false”. Backup profile if return is “true”.

Test-Path $profile

Step2. Create PowerShell profile, then test the file. Return of second command should be “true”

New-Item -Path $profile -type file -force | Out-Null
Test-Path $profile

Step3. Add PowerCLI to profile.

Add-Content -Path $profile -value "# Load Windows PowerShell cmdlets for managing vSphere `r`nAdd-PsSnapin VMware.VimAutomation.Core -ea SilentlyContinue"

Note:

  1. This is tested on Windows 10 only. Windows 7 or earlier version maybe different.
  2. You must reboot after integration otherwise you will get following message when you open PowerCLI.
    A provider is not available for the following required component service: CisCoreService
Advertisements

3 thoughts on “How to integrate PowerCLI with PowerShell and PowerShell ISE

  1. Pingback: How to Integrate PowerCLI 6.5 with PowerShell and PowerShell ISE – Wu's Blog

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