diff --git a/documentation/Remove-PnPTermLabel.md b/documentation/Remove-PnPTermLabel.md index 41bba1c91..4a94d4df4 100644 --- a/documentation/Remove-PnPTermLabel.md +++ b/documentation/Remove-PnPTermLabel.md @@ -22,7 +22,7 @@ Remove-PnPTermLabel -Lcid [-TermStore ] [-Connection ] - [-Confirm] + [-Force] ``` @@ -36,7 +36,7 @@ Remove-PnPTermLabel -TermGroup [-TermStore ] [-Connection ] - [-Confirm] + [-Force] ``` @@ -60,13 +60,12 @@ Removes the Swedish label from the specified term. ## PARAMETERS -### -Confirm -Prompts you for confirmation before running the cmdlet. +### -Force +Specifying the Force parameter will skip the confirmation question. ```yaml Type: SwitchParameter Parameter Sets: (All) -Aliases: cf Required: False Position: Named diff --git a/src/Commands/Taxonomy/RemoveTermLabel.cs b/src/Commands/Taxonomy/RemoveTermLabel.cs index 8bcb7ed38..3c9e8d19b 100644 --- a/src/Commands/Taxonomy/RemoveTermLabel.cs +++ b/src/Commands/Taxonomy/RemoveTermLabel.cs @@ -32,6 +32,9 @@ public class RemoveTermLabel : PnPSharePointCmdlet [Parameter(Mandatory = false, ValueFromPipeline = true, ParameterSetName = ParameterAttribute.AllParameterSets)] public TaxonomyTermStorePipeBind TermStore; + [Parameter(Mandatory = false)] + public SwitchParameter Force; + protected override void ExecuteCmdlet() { var taxonomySession = TaxonomySession.GetTaxonomySession(ClientContext); @@ -67,7 +70,7 @@ protected override void ExecuteCmdlet() if (term != null) { term.EnsureProperties(t => t.Name, t => t.Id); - if (ShouldContinue($"Delete label {Label} for language {Lcid} from Term {term.Name} with id {term.Id}", Properties.Resources.Confirm)) + if (Force || ShouldContinue($"Delete label {Label} for language {Lcid} from Term {term.Name} with id {term.Id}", Properties.Resources.Confirm)) { var labels = term.GetAllLabels(Lcid); ClientContext.Load(labels);