Hi!
i start write small script to check, that all disks at vm have EagerZeroedThick format.
And add this to expression cell.
But I am sure that the script is incorrect:
Get-Vm -Location myvms | select @{N="VM Name";E={$_.Name}},
@{N="Storformat";E={ if ((Get-HardDisk $_).storageformat -eq 'EagerZeroedThick') {Write-Host "ALL EagerZeroedThick"} else {NOT ALL disks in EagerZeroedThick format} }}
Try something like this
Get-Vm -Location myvms |
Select Name,
@{N='StorFormat';E={
if((Get-HardDisk -VM $_ | ForEach-Object -Process {
$_.storageformat -eq 'EagerZeroedThick'
}) -contains $false){'Not all disks in EagerZeroedThick'}
else{'All EagerZeroedThick'}
}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Try something like this
Get-Vm -Location myvms |
Select Name,
@{N='StorFormat';E={
if((Get-HardDisk -VM $_ | ForEach-Object -Process {
$_.storageformat -eq 'EagerZeroedThick'
}) -contains $false){'Not all disks in EagerZeroedThick'}
else{'All EagerZeroedThick'}
}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you LucD!