LucD - I ran the code you provided above and this is the error message received.
Select-Object : A parameter cannot be found that matches parameter name 'VM'. At line:1 char:152 + foreach($vm in (Get-Folder -Name "TEST" |Get-vm)){$snap = Get-Snapshot -VM $v m | Sort-Object -Property Created -Descending | Select -First 1 Set-VM -VM <<<< $vm -SnapShot $snap -Confirm:$false} + CategoryInfo : InvalidArgument: (:) [Select-Object], ParameterB indingException + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Comm ands.SelectObjectCommand Select-Object : A parameter cannot be found that matches parameter name 'VM'. At line:1 char:152 + foreach($vm in (Get-Folder -Name "TEST" |Get-vm)){$snap = Get-Snapshot -VM $v m | Sort-Object -Property Created -Descending | Select -First 1 Set-VM -VM <<<< $vm -SnapShot $snap -Confirm:$false} + CategoryInfo : InvalidArgument: (:) [Select-Object], ParameterB indingException + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Comm ands.SelectObjectCommand