You could do something like this.
You can eventually ut a break in the else-block, so this message doesn't repeat for each VM still in the pipeline.
$destin="DS39"
Get-Datastore$source|Get-VM-PipelineVariable vm |
ForEach-Object-Process {
$destDS=Get-Datastore$destin
if($destDS.FreeSpaceGB/$destDS.CapacityGB-gt0.2){
$task=Move-VM-VM $vm-Datastore $destin-RunAsync
while($task.PercentComplete-ne100){
Start-Sleep5
$task=Get-Task-Id $task.Id
$sProg=@{
Activity ="$vm Storage vMotion from $source to $destin"
Status ="$($task.PercentComplete)%"
PercentComplete=([int]($task.PercentComplete))
}
Write-Progress@sProg
}
}
else{
Write-Host"Destination doesn't have 20% of free space"
}
}