I want to find the ancestor of an item that matches the given template id using Powershell. Can anyone help me in achieving this?
Scenario: I'm on Item A, I get the current item details using gi .
. From item A I want to navigate upwards and find the ancestor with matching TemplateID.
Example:
Home
-- Parent 1
-- Parent 2
-- Item A