In my last project I found myself needing the list of latest versions of items of certain template under a specific root.
While I have a cmdlet in the project for this now, I thought that this would be a worthy addition to the OOTB Find-Item Cmdlet.
The possible usage of Find-Item - that can be substitute as a blazing-fast and easy to use version of Get-ChildItem:
Find-Item `
-Template "Foundation/SxaExtensions/_ScaffoldingCorporateHomePage" `
-LatestVersion `
-Path master:\templates | Initialize-Item
You may also notice that the -Index Parameter is missing as it is now optional. If it is not specified it will attempt to use the sitecore_{drive}_index or if not available - fall-back to sitecore_master_index so the most common scenario requires less code.
Those parameters can be mixed with other criteria.
In my last project I found myself needing the list of latest versions of items of certain template under a specific root.
While I have a cmdlet in the project for this now, I thought that this would be a worthy addition to the OOTB
Find-ItemCmdlet.The possible usage of
Find-Item- that can be substitute as a blazing-fast and easy to use version ofGet-ChildItem:You may also notice that the
-IndexParameter is missing as it is now optional. If it is not specified it will attempt to use thesitecore_{drive}_indexor if not available - fall-back tositecore_master_indexso the most common scenario requires less code.Those parameters can be mixed with other criteria.