Tried running bellow command but "Duration" filter fails.
Get-DbaAgentJob -SqlInstance instance_name | `
| Get-DbaAgentJobHistory -StartDate '2022-08-02' -EndDate '2022-08-03' `
| Where-Object Duration -gt [TimeSpan]'00:05:00'
Error message:
Where-Object : The 'Igt' operator failed: Could not compare "00:01:32" to "[TimeSpan]00:05:00". Error: "Cannot convert value "[TimeSpan]00:05:00" to type "Sqlcollaborative.Dbatools.Utility.DbaTimeSpanPretty". Error: "Failed to parse as timespan: [TimeSpan]00:05:00 at [TimeSpan]00:05:00"". At line:3 char:7 | Where-Object Duration -gt [TimeSpan]'00:05:00' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CategoryInfo : InvalidOperation: (System.Data.DataRow:PSObject) [Where-Object], PSInvalidOperationException FullyQualifiedErrorId : OperatorFailed,Microsoft.PowerShell.Commands.WhereObjectCommand