- Blog

Keep it simple

Automatically loading PowerCLI module when loading PowerShell ISE

written on 15 October 2017
Powershell uses several "profile" scripts that are comparable to a `.bashrc`. You can determine the currently loaded profile by examining the `$profile` variable: ```powershell > $profile C:\Users\user\Documents\WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1 ``` You will notice, that this ISE profile is different from that used in PowerCLI. However, you can create this file and use it to import the VMware PowerCLI module when ISE starts: ```powershell # Load PowerCLI commandlets for managing vSphere Import-Module VMware.VimAutomation.Core -ErrorAction SilentlyContinue ``` After restarting PowerShell ISE, you should now be able to use commandlets like `Connect-VIServer` or `Get-VM`