Skip to content

Commit 09ba1ec

Browse files
authored
Merge pull request #3321 from sparkitect/patch-1
Update SetTerm.cs to add support for tagging availability
2 parents e511f87 + 494d5df commit 09ba1ec

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
2525
- Added `-ReduceTempTokenLifetimeEnabled`, `-ReduceTempTokenLifetimeValue`, `-ViewersCanCommentOnMediaDisabled`, `-AllowGuestUserShareToUsersNotInSiteCollection`, `-ConditionalAccessPolicyErrorHelpLink`, `-CustomizedExternalSharingServiceUrl`, `-IncludeAtAGlanceInShareEmails` and `-MassDeleteNotificationDisabled` to `Set-PnPTenant` [#3348](https://github.com/pnp/powershell/pull/3348)
2626
- 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)
2727
- Added `Get-PnPFlowOwner` cmdlet which allows retrieving the owners of a Power Automate flow [#3314](https://github.com/pnp/powershell/pull/3314)
28+
- 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)
2829

2930
### Fixed
3031

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

5960
### Contributors
6061

62+
- Jim Duncan [sparkitect]
6163
- Jonathan Smith [jonathan-m-smith]
6264
- Carl Joakim Damsleth [damsleth]
6365
- Rodel Pacurib [ryder-cayden]

documentation/Set-PnPTerm.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ Updates a term
1818
```
1919
Set-PnPTerm -Identity <Guid> [-Name <String>] [-Lcid <Int32>] [-Description <String>]
2020
[-CustomProperties <Hashtable>] [-LocalCustomProperties <Hashtable>] [-DeleteAllCustomProperties]
21-
[-DeleteAllLocalCustomProperties] [-Deprecated <bool>] [-TermStore <TaxonomyTermStorePipeBind>]
21+
[-DeleteAllLocalCustomProperties] [-Deprecated <bool>] [-AvailableForTagging <bool>] [-TermStore <TaxonomyTermStorePipeBind>]
2222
2323
```
2424

2525
### By Term Name
2626
```
2727
Set-PnPTerm -Identity <String> [-Name <String>] [-Lcid <Int32>] [-Description <String>]
2828
[-CustomProperties <Hashtable>] [-LocalCustomProperties <Hashtable>] [-DeleteAllCustomProperties]
29-
[-DeleteAllLocalCustomProperties] [-Deprecated <bool>] -TermSet <TaxonomyTermSetPipeBind> -TermGroup <TaxonomyTermGroupPipeBind>
29+
[-DeleteAllLocalCustomProperties] [-Deprecated <bool>] [-AvailableForTagging <bool>] -TermSet <TaxonomyTermSetPipeBind> -TermGroup <TaxonomyTermGroupPipeBind>
3030
[-TermStore <TaxonomyTermStorePipeBind>]
3131
```
3232

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

6666
## PARAMETERS
6767

68+
### -AvailableForTagging
69+
Sets a term to be available for tagging or not.
70+
71+
```yaml
72+
Type: boolean
73+
Parameter Sets: (All)
74+
Aliases:
75+
76+
Required: False
77+
Position: Named
78+
Default value: None
79+
Accept pipeline input: False
80+
Accept wildcard characters: False
81+
```
82+
6883
### -CustomProperties
6984
Sets custom properties.
7085

src/Commands/Taxonomy/SetTerm.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ public class SetTerm : PnPRetrievalsCmdlet<Term>
5353
[Parameter(Mandatory = false)]
5454
public bool Deprecated;
5555

56+
[Parameter(Mandatory = false)]
57+
public bool? AvailableForTagging;
58+
5659
protected override void ExecuteCmdlet()
5760
{
5861
DefaultRetrievalExpressions = new Expression<Func<Term, object>>[] { g => g.Name, g => g.TermsCount, g => g.Id };
@@ -130,11 +133,16 @@ protected override void ExecuteCmdlet()
130133
{
131134
term.Deprecate(Deprecated);
132135
}
136+
137+
if (ParameterSpecified(nameof(AvailableForTagging)) && AvailableForTagging.HasValue)
138+
{
139+
term.IsAvailableForTagging = AvailableForTagging.Value;
140+
}
141+
133142
ClientContext.Load(term);
134143
termStore.CommitAll();
135144
ClientContext.ExecuteQueryRetry();
136145
WriteObject(term);
137146
}
138147
}
139-
}
140-
148+
}

0 commit comments

Comments
 (0)