Skip to content

Commit c63a82b

Browse files
Add -Force parameter to Remove-PnPTerm (#5077)
Co-authored-by: Gautam Sheth <[email protected]>
1 parent 4b24af7 commit c63a82b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Commands/Taxonomy/RemoveTerm.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ public class RemoveTerm : PnPSharePointCmdlet
2525
[Parameter(Mandatory = false, ParameterSetName = ParameterAttribute.AllParameterSets)]
2626
public TaxonomyTermStorePipeBind TermStore;
2727

28+
[Parameter(Mandatory = false, ParameterSetName = ParameterAttribute.AllParameterSets)]
29+
public SwitchParameter Force;
2830

2931
protected override void ExecuteCmdlet()
3032
{
@@ -51,7 +53,7 @@ protected override void ExecuteCmdlet()
5153
var termSet = TermSet.GetTermSet(termGroup);
5254
term = Identity.GetTerm(ClientContext, termStore, termSet, false, null);
5355
}
54-
if (ShouldContinue($"Delete term {term.Name} with id {term.Id}", Properties.Resources.Confirm))
56+
if (Force || ShouldContinue($"Delete term {term.Name} with id {term.Id}", Properties.Resources.Confirm))
5557
{
5658
term.DeleteObject();
5759
termStore.CommitAll();

0 commit comments

Comments
 (0)