Skip to content

Commit a221a96

Browse files
Fix bug #5018 (#5023)
* fix for bug #4943 * fix for #5018 --------- Co-authored-by: Gautam Sheth <[email protected]>
1 parent af577c9 commit a221a96

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

documentation/Remove-PnPTermLabel.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Remove-PnPTermLabel
2222
-Lcid <Int32>
2323
[-TermStore <Guid>]
2424
[-Connection <PnPConnection>]
25-
[-Confirm]
25+
[-Force]
2626
2727
```
2828

@@ -36,7 +36,7 @@ Remove-PnPTermLabel
3636
-TermGroup <Name|Guid>
3737
[-TermStore <Guid>]
3838
[-Connection <PnPConnection>]
39-
[-Confirm]
39+
[-Force]
4040
4141
```
4242

@@ -60,13 +60,12 @@ Removes the Swedish label from the specified term.
6060

6161
## PARAMETERS
6262

63-
### -Confirm
64-
Prompts you for confirmation before running the cmdlet.
63+
### -Force
64+
Specifying the Force parameter will skip the confirmation question.
6565

6666
```yaml
6767
Type: SwitchParameter
6868
Parameter Sets: (All)
69-
Aliases: cf
7069

7170
Required: False
7271
Position: Named

src/Commands/Taxonomy/RemoveTermLabel.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ public class RemoveTermLabel : PnPSharePointCmdlet
3232
[Parameter(Mandatory = false, ValueFromPipeline = true, ParameterSetName = ParameterAttribute.AllParameterSets)]
3333
public TaxonomyTermStorePipeBind TermStore;
3434

35+
[Parameter(Mandatory = false)]
36+
public SwitchParameter Force;
37+
3538
protected override void ExecuteCmdlet()
3639
{
3740
var taxonomySession = TaxonomySession.GetTaxonomySession(ClientContext);
@@ -67,7 +70,7 @@ protected override void ExecuteCmdlet()
6770
if (term != null)
6871
{
6972
term.EnsureProperties(t => t.Name, t => t.Id);
70-
if (ShouldContinue($"Delete label {Label} for language {Lcid} from Term {term.Name} with id {term.Id}", Properties.Resources.Confirm))
73+
if (Force || ShouldContinue($"Delete label {Label} for language {Lcid} from Term {term.Name} with id {term.Id}", Properties.Resources.Confirm))
7174
{
7275
var labels = term.GetAllLabels(Lcid);
7376
ClientContext.Load(labels);

0 commit comments

Comments
 (0)