Win7 installation and use of PowerCLI
Installation steps
1. Download and install versions of PowerShell 3.0 or later
Https://www.microsoft.com/en-us/download/details.aspx?id=34595
two。 Download and install PowerCLI by default
Https://my.vmware.com/web/vmware/details?downloadGroup=PCLI650R1&productId=614
3. Scripts that are disabled by the system will appear when you connect for the first time after installation
4. Allow the system to run scripts and close windows
Use to open PowerCLIPowerCLI as an administrator and execute the command: set-ExecutionPolicy RemoteSigned
5. Use to reopen PowerCli as an administrator
Normal launch page
# #
PowerCLI common commands
a. Connect to the host or Vcenter
Connect-VIServer-server host_ip-user user_name-password' password'
b. Get a list of virtual machines
Get-vm
Get-VM-location esxhost / / * get the list of virtual machines for the host
c. Delete a virtual machine
Remove-vm vm_name / / * removed from the list
Remove-VM vm_name-deletepermanently / / * remove a virtual machine from disk
d. Power operation to virtual machine
Stop-VM-vm vm_name / / * Power off the virtual machine
Restart-VM-vm vm_name / / * reset the virtual machine
Restart-VMGuest-vm vm_name / / * reboot the virtual machine
Start-VM-vm vm_name / / * Power on the virtual machine
Reference documentation:
Https://kb.vmware.com/s/article/2012964?lang=zh_CN