Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Added `-ReduceTempTokenLifetimeEnabled`, `-ReduceTempTokenLifetimeValue`, `-ViewersCanCommentOnMediaDisabled`, `-AllowGuestUserShareToUsersNotInSiteCollection`, `-ConditionalAccessPolicyErrorHelpLink`, `-CustomizedExternalSharingServiceUrl`, `-IncludeAtAGlanceInShareEmails` and `-MassDeleteNotificationDisabled` to `Set-PnPTenant` [#3348](https://github.com/pnp/powershell/pull/3348)
- Added `Add-PnPFlowOwner` and `Remove-PnPFlowOwner` cmdlets which allow granting or removing permissions to a Power Automate flow [#3343](https://github.com/pnp/powershell/pull/3343)
- Added `Get-PnPFlowOwner` cmdlet which allows retrieving the owners of a Power Automate flow [#3314](https://github.com/pnp/powershell/pull/3314)
- Added `-AvailableForTagging` to `Set-PnPTerm` which allows the available for tagging property on a Term to be set [#3321](https://github.com/pnp/powershell/pull/3321)

### Fixed

Expand Down Expand Up @@ -58,6 +59,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

### Contributors

- Jim Duncan [sparkitect]
- Jonathan Smith [jonathan-m-smith]
- Carl Joakim Damsleth [damsleth]
- Rodel Pacurib [ryder-cayden]
Expand Down
19 changes: 17 additions & 2 deletions documentation/Set-PnPTerm.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ Updates a term
```
Set-PnPTerm -Identity <Guid> [-Name <String>] [-Lcid <Int32>] [-Description <String>]
[-CustomProperties <Hashtable>] [-LocalCustomProperties <Hashtable>] [-DeleteAllCustomProperties]
[-DeleteAllLocalCustomProperties] [-Deprecated <bool>] [-TermStore <TaxonomyTermStorePipeBind>]
[-DeleteAllLocalCustomProperties] [-Deprecated <bool>] [-AvailableForTagging <bool>] [-TermStore <TaxonomyTermStorePipeBind>]

```

### By Term Name
```
Set-PnPTerm -Identity <String> [-Name <String>] [-Lcid <Int32>] [-Description <String>]
[-CustomProperties <Hashtable>] [-LocalCustomProperties <Hashtable>] [-DeleteAllCustomProperties]
[-DeleteAllLocalCustomProperties] [-Deprecated <bool>] -TermSet <TaxonomyTermSetPipeBind> -TermGroup <TaxonomyTermGroupPipeBind>
[-DeleteAllLocalCustomProperties] [-Deprecated <bool>] [-AvailableForTagging <bool>] -TermSet <TaxonomyTermSetPipeBind> -TermGroup <TaxonomyTermGroupPipeBind>
[-TermStore <TaxonomyTermStorePipeBind>]
```

Expand Down Expand Up @@ -65,6 +65,21 @@ Marks an existing term as deprecated, hiding it from users.

## PARAMETERS

### -AvailableForTagging
Sets a term to be available for tagging or not.

```yaml
Type: boolean
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -CustomProperties
Sets custom properties.

Expand Down
12 changes: 10 additions & 2 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 : PnPRetrievalsCmdlet<Term>
[Parameter(Mandatory = false)]
public bool Deprecated;

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

protected override void ExecuteCmdlet()
{
DefaultRetrievalExpressions = new Expression<Func<Term, object>>[] { g => g.Name, g => g.TermsCount, g => g.Id };
Expand Down Expand Up @@ -130,11 +133,16 @@ protected override void ExecuteCmdlet()
{
term.Deprecate(Deprecated);
}

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

ClientContext.Load(term);
termStore.CommitAll();
ClientContext.ExecuteQueryRetry();
WriteObject(term);
}
}
}

}