Cli-microsoft365: Enhancement: Include child terms when querying a specific term or term group

Created on 25 Nov 2019  路  5Comments  路  Source: pnp/cli-microsoft365

We are currently using the Sharepoint PnP PowerShell module to interact with Sharepoint Term Store programmatically.

That module only works on Windows, and we now want to leverage PowerShell Core cross-platform to do similar tasks. Hence, we have looked into the office365-cli. This looks very promising since it can return JSON output allowing us to customize the output as needed.

However, we do need to traverse child terms and retain the data structure, hence it would be a great enhancement to the office365-cli to add this capability.

Most helpful comment

Yes, that is correct 馃憤馃槉

All 5 comments

Welcome @janegilring 馃憢馃徎

Thank you for your suggestion 馃憤馃徎

This is definitely something that we can look to implement in our spo term get command.

After a quick look at the Get-PnPTerm cmdlet I see that it has two options, -IncludeChildTerms & -Recursive, which option do you currently use in your scripts?

Thanks! 馃槉

I actually use both:
Get-PnPTerm -TermGroup Custom -TermSet $TermSet -IncludeChildTerms -Recursive

I see 馃槉

So that we are clear about the functionality you are proposing to be added, are the below statements accurate?

-Recursive returns the requested term from a given termset irrespective of the level the term is situated in the hierarchy (2nd, 3rd, 4th level terms). If omitted, the command will only return terms that are first level terms.
-IncludeChildTerms returns the requested term from a given termset and also includes the child terms of the requested term.

Yes, that is correct 馃憤馃槉

@janegilring I have raised two new issues, which are referenced, to cover the implementation of the functionality that you have requested. I will therefore close this issue.

If you have any more suggestions, please do submit more 馃槉 馃憤馃徎

Was this page helpful?
0 / 5 - 0 ratings