本周一晚新公司部门部分人员聚餐,圆桌九人围坐,80后占其八,皆五年以上IT龄,老大为长者。

席间玩一游戏,找众将之共同点,

一人曰,有白发者喝酒,众将皆举杯,皆尽。

  • 首先到官方网站下载VMware vSphere PowerCLI的软件包,

vmware 安装powercli及其使用_Windows

  • 安装软件到本机,

vmware 安装powercli及其使用_软件包_02

  • 运行后提示:”无法加载文件c:program Filesvmwareinfrastructurevsphere powerCLIscriptinitialize-vitoolkitenviroment.ps1,因为在此系统中禁止执行脚本。有关信息,请查阅“get-help about_signing”.

vmware 安装powercli及其使用_安装_03

  • 通过get-executionpolicy查看本地执行策略

vmware 安装powercli及其使用_Windows_04

  • 更改执行策略

vmware 安装powercli及其使用_软件包_05

  • 更改为RemoteSigned执行策略

vmware 安装powercli及其使用_安装_06

备注:

Restricted 执行策略不允许任何脚本运行。  
AllSigned 和 RemoteSigned 执行策略可防止 Windows PowerShell 运行没有数字签名的脚本。

  • 再次运行VMware vSphere PowerCLI,提示”Welcome“界面,工具正常启动。

vmware 安装powercli及其使用_共同点_07

  • 输入Connect-VIServer ,连接上vCenter服务器

vmware 安装powercli及其使用_Windows_08

  • 输入vCenter的登录用户名和密码。

  • vmware 安装powercli及其使用_安装_09