I'm working on a PSE script that will work on different sitecore environment with different sitecore versions. This script basically get the list of items that is recently updated between to given dates.
$fromdate = New-Object DateTime 2020, 8, 1, 0, 0, 0, ([DateTimeKind]::Utc)
$todate = New-Object DateTime 2020, 12, 1, 0, 0, 0, ([DateTimeKind]::Utc)
$criteria = @(
@{Filter = "GreaterThan"; Field = "__smallupdateddate"; Value = $fromdate}
@{Filter = "LessThan"; Field = "__smallupdateddate"; Value = $todate}
)
#return list code goes here
However in one of the environments with SPE 3.0 installed that script is not working. anyone could help me how to do this that is compatible with lower versions of SPE? This is the error I am getting:
Find-Item : Cannot bind parameter 'Criteria'. Cannot create object of type "Cognifide.PowerShell.Commandlets.Data.Search.SearchCriteria". Cannot convert value "GreaterThan" to type "Cognifide.PowerShell.Commandlets.Data.Search.FilterType". Error: "Unable to match the identifier name GreaterThan to a valid enumerator name. Specify one of the following enumerator names and try again: None, Equals, StartsWith, Contains, ContainsAll, ContainsAny, EndsWith, DescendantOf, Fuzzy, InclusiveRange, ExclusiveRange, MatchesRegex, MatchesWildcard"
Thanks, Borj