Hi there,
I've managed to write a small script with the help of @Zsoldier function from a previous post.
Make sure to copy and define the "Get-vCenterScheduledTask" function before running the script below, as the command will only work after the function is defined.
$limit = (Get-Date).AddDays(-60)
Get-vCenterScheduledTask | Where-Object {
$_.PrevRunTime -lt $limit
} | ForEach-Object {
$taskview = Get-View $_.ScheduledTask
$taskview.RemoveScheduledTask()
Write-Host "Deleted task: $($_.Name)"
}
In my example I used a limit for scheduled tasks older than 60 days (last run time).