Try changing line 37 (in the original function) into this
$NumvMotionTasks = (Get-Task | ? { ($_.PercentComplete -ne 100) -and ($_.Description -match 'Relocate')} | Measure-Object).Count
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference