File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff 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
6767Type : SwitchParameter
6868Parameter Sets : (All)
69- Aliases : cf
7069
7170Required : False
7271Position : Named
Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments