Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find-Item Add support for GreaterThan LessThan when searching by date and number #1128

Closed
michaellwest opened this issue Aug 18, 2019 · 1 comment
Assignees
Labels
area-commands Involves functions and cmdlets. improvement Extra sugar and spice.
Milestone

Comments

@michaellwest
Copy link
Member

I would like to have the following work:

$criteria = @(
    @{Filter = "LessThan"; Field = "__smallupdateddate"; Value = [datetime]"08/01/2019"} 
)
$props = @{
    Index = "sitecore_master_index"
    Criteria = $criteria
}

Find-Item @props
$criteria = @(
    @{Filter = "GreaterThan"; Field = "size"; Value = 1000} 
)
$props = @{
    Index = "sitecore_master_index"
    Criteria = $criteria
}

Find-Item @props
@michaellwest michaellwest self-assigned this Aug 18, 2019
@michaellwest michaellwest added this to the 6.0 milestone Aug 18, 2019
@michaellwest michaellwest added area-commands Involves functions and cmdlets. improvement Extra sugar and spice. labels Aug 18, 2019
michaellwest added a commit that referenced this issue Aug 18, 2019
Covers double, int, and datetime.
@michaellwest
Copy link
Member Author

Noticed that if I want to adhere to the time in UTC, the datetime object should be created in UTC.

$date = New-Object DateTime 2019, 8, 1, 0, 0, 0, ([DateTimeKind]::Utc)

$criteria = @(
    @{Filter = "LessThan"; Field = "__smallupdateddate"; Value = $date} 
)
$props = @{
    Index = "sitecore_master_index"
    Criteria = $criteria
}

Find-Item @props

@michaellwest michaellwest added -release-highlight Exciting change that should be highlighted in the release notes and celebrated by SPE fans. and removed -release-highlight Exciting change that should be highlighted in the release notes and celebrated by SPE fans. labels Sep 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-commands Involves functions and cmdlets. improvement Extra sugar and spice.
Projects
No open projects
Development

No branches or pull requests

1 participant