Sunday, April 10, 2016

How to prepare PowerCLI environment on windows 7 and prepare PowerShell ISE

I am  a newbie for Powershell and PowerCli , so just write a notes .

Step one : Install Powershell on Windows 7 

 1.1, Install .NET Framework 4.0 or later
 I download .NET Framework 4.5.2 offline installer ,

 1.2  Install the Windows Management Framework 3.0 

  • If you have Windows 7 64-bit, you want the file named: Windows6.1-KB2506143-x64.msu
  • If you have Windows 7 32-bit, you want the file named: Windows6.1-KB2506143-x86.msu
   Step Two: Install PowerCLI
   Go to VMware PowerCLI Site,download the latest version .


Also I need a development environment  for PowerShell , the first option  is 

Integrated Scripting Environment (ISE)


If you want to use ISE , just need to type command "Powershell_ise" in vsphere powershell. 



After that, I got a new issue " ISE didn't load vsphere module". 

Here is my simply way , Write a Powershell_ISE profile .

"C:\Users\shensong\Documents\WindowsPowershell\Microsoft.PowerShellISE_profile"

the content:
"& 'C:\Program Files (x86)\VMware\Infrastructure\vSphere PowerCLI\Scripts\Initialize-PowerCLIEnvironment.ps1'"


You can type "echo $profile" to check your current powershell profile.Note that, Powershell ISE load different profile than Powershell 



No comments: