Friday, March 1, 2019

PowerCLI Modules in PowerShell ISE


Open PowerShell ISE




STEP 1
$Profile

C:\Users\Admin\Documents\WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1

If it show output like above please proceed to STEP 3

If it show nothing or error then please proceed with STEP 2 


STEP 2

Test-Path $profile
False

New-Item -path $profile -type file -force

Test-Path $profile
True

After this you can check again for profile

 $Profile

This time it will show you profile path as shown in STEP 1

STEP 3

Now you need open the profile file and the line for PowerCLI.

In PowerShell ISE window Type below then please press enter

PowerShell_ise $profile

it will open the profile file in edit section, like in image below:



Now you need to type in the text section:

cd "C:\Program Files (x86)\VMware\Infrastructure\PowerCLI\Scripts" .\Initialize-PowerCLIEnvironment.ps1 cd c:\

Then Click on save button. Once done close PowerShell ISE.

For reference please see below:



Open Powershell ISE now this will come with PowerCLI Module loaded.

Enjoy....




No comments: