Skip to content

Commit

Permalink
Update SetTerm.cs to add support for tagging availability
Browse files Browse the repository at this point in the history
Added support for "Available for Tagging" setting on a Term (I think).
  • Loading branch information
sparkitect authored Aug 1, 2023
1 parent c191c81 commit c489aa9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Commands/Taxonomy/SetTerm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ public class SetTerm : PnPSharePointCmdlet
[Parameter(Mandatory = false)]
public bool Deprecated;

[Parameter(Mandatory = false)]
public bool AvailableForTagging;

protected override void ExecuteCmdlet()
{
var taxonomySession = TaxonomySession.GetTaxonomySession(ClientContext);
Expand Down Expand Up @@ -112,6 +115,12 @@ protected override void ExecuteCmdlet()
{
term.Deprecate(Deprecated);
}

if (ParameterSpecified(nameof(AvailableForTagging)))
{
term.IsAvailableForTagging = AvailableForTagging;
}

ClientContext.Load(term);
termStore.CommitAll();
ClientContext.ExecuteQueryRetry();
Expand Down

0 comments on commit c489aa9

Please sign in to comment.