How to import powerCLI modules into standard Powershell ISE

Sometimes it’s useful to have opportunity to run and debug powerCLI scripts/functions from standard Powershell ISE

  1. install on AdminPC powerCLI
  2. open Powershell ISE
  3. copy and paste into command line below:
    Import-Module VMware.DeployAutomation
    Import-Module VMware.ImageBuilder
    Import-Module VMware.VimAutomation.Cis.Core
    Import-Module VMware.VimAutomation.Common
    Import-Module VMware.VimAutomation.Core
    Import-Module VMware.VimAutomation.HA
    Import-Module VMware.VimAutomation.License
    Import-Module VMware.VimAutomation.Sdk
    Import-Module VMware.VimAutomation.Storage
    Import-Module VMware.VimAutomation.vds

if you need to have powerCLI modules in Powershell ISE always, then create under your user account powershell profile:

    1. new-item -path $profile -itemtype file -force
    2. powershell_ise $profile
    3. and add into your profile above commands, or just one line
      .’C:\Program Files (x86)\VMware\Infrastructure\PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1′
    4. save your powershell profile.