Powercli: Difference between revisions

From roonics
Jump to navigation Jump to search
Line 19: Line 19:
<pre>get-vm | get-snapshot | format-list vm,name</pre>
<pre>get-vm | get-snapshot | format-list vm,name</pre>


===List vms file locations for vm's===
===List vmx file locations for vm's===
<pre>Get-View -ViewType VirtualMachine | % { $_.Config.Files.VmPathName }</pre>
<pre>Get-View -ViewType VirtualMachine | % { $_.Config.Files.VmPathName }</pre>

Revision as of 10:31, 15 March 2019

Powercli

Useful Commands

Update vmTools with no reboot

Get-VM "<vm_name>" | Update-Tools -NoReboot

Create snapshot

new-snapshot -vm <vm_name> -name snapshot_test

Remove snapshot

get-snapshot -vm <vm_name> | remove-snapshot

vMotion

get-vm -Name <vm_name> | move-vm -Destination <hostname_or_host_ip>

Storage vMotion

Get-VM "<vm_name>" | Move-VM -Datastore <datastore_name>

List all virtual machines with snapshots

get-vm | get-snapshot | format-list vm,name

List vmx file locations for vm's

Get-View -ViewType VirtualMachine | % { $_.Config.Files.VmPathName }