VMWare/powerCLI: Unterschied zwischen den Versionen

Aus SchnallIchNet
Wechseln zu: Navigation, Suche
(get list of snapshots (of all VMs))
(get list of snapshots (of all VMs))
 
Zeile 9: Zeile 9:
  
 
  get-vm | get-snapshot | format-list VM,Created,SizeGB,IsCurrent
 
  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 VMWare-Tools status ===
  
 
  get-vm | % { get-view $_.id } | select Name, @{ Name="ToolsVersion"; Expression={$_.config.tools.toolsVersion}},@{ Name="ToolStatus"; Expression={$_.Guest.ToolsVersionStatus}}
 
  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}}