📜  获取当前快照大小 - 无论代码示例

📅  最后修改于: 2022-03-11 14:57:02.728000             🧑  作者: Mango

代码示例1
$Report = Get-VM | Get-Snapshot | Select VM,Name,Description,@{Label="Size";Expression={"{0:N2} GB" -f ($_.SizeGB)}},Created
If (-not $Report)
{  $Report = New-Object PSObject -Property @{
      VM = "No snapshots found on any VM's controlled by $VIServer"
      Name = ""
      Description = ""
      Size = ""
      Created = ""
   }
}
$Report = $Report | Select VM,Name,Description,Size,Created | ConvertTo-Html -Head $Header -PreContent "

Snapshot Report - $VIServer


" | Set-AlternatingRows -CSSEvenClass even -CSSOddClass odd