PowerCLI Powerhsell

From Michael's Information Zone
Jump to navigation Jump to search

Allow powershell to run powercli cmdlets

Set-ExecutionPolicy RemoteSigned

Log into the server and start using commands

$cred=get-credential
connect-viserver -server localhost -credential $cred
get-vm

Clone VM

new-vm -name <new_machine_name> -vm <source_machine_name> -vmhost <ip or host name of the physical host, not the controller>

Delete VM

remote-vm -vm <namme_of_vm> -deletepermanently  -confirm $false