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

7 Replies to “How to integrate PowerCLI with PowerShell and PowerShell ISE”

Leave a Reply