VMWare/powerCLI: Unterschied zwischen den Versionen

Aus SchnallIchNet
Wechseln zu: Navigation, Suche
(Die Seite wurde neu angelegt: „ == Snippets == yadda === get list of snapshots (of all VMs) === get-vm | get-snapshot | format-list VM,SizeGB“)
 
(get list of snapshots (of all VMs))
 
(2 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 8: Zeile 8:
 
=== get list of snapshots (of all VMs) ===
 
=== get list of snapshots (of all VMs) ===
  
  get-vm | get-snapshot | format-list VM,SizeGB
+
  get-vm | get-snapshot | format-list VM,Created,SizeGB,IsCurrent
 +
 
 +
or
 +
 
 +
<pre>
 +
foreach($vm in Get-View -ViewType VirtualMachine -Property Name,Snapshot -Filter @{'Snapshot' = ''}){
 +
 
 +
  $vm.Snapshot.RootSnapshotList | %{
 +
 
 +
  Get-SnapChild -Snapshot $_ | Select @{N='VM';E={$vm.name}},@{N='Snapshot';E={$_}}
 +
 
 +
  }
 +
 
 +
}
 +
</pre>
 +
 
 +
=== get VMWare-Tools status ===
 +
 
 +
get-vm | % { get-view $_.id } | select Name, @{ Name="ToolsVersion"; Expression={$_.config.tools.toolsVersion}},@{ Name="ToolStatus"; Expression={$_.Guest.ToolsVersionStatus}}

Aktuelle Version vom 11. September 2019, 10:30 Uhr


Snippets

yadda


get list of snapshots (of all VMs)

get-vm | get-snapshot | format-list VM,Created,SizeGB,IsCurrent

or

foreach($vm in Get-View -ViewType VirtualMachine -Property Name,Snapshot -Filter @{'Snapshot' = ''}){

   $vm.Snapshot.RootSnapshotList | %{

   Get-SnapChild -Snapshot $_ | Select @{N='VM';E={$vm.name}},@{N='Snapshot';E={$_}}

   }

}

get VMWare-Tools status

get-vm | % { get-view $_.id } | select Name, @{ Name="ToolsVersion"; Expression={$_.config.tools.toolsVersion}},@{ Name="ToolStatus"; Expression={$_.Guest.ToolsVersionStatus}}