Skip to content

Commit 7f2dd52

Browse files
Potential fix for bug #5145 to suppress any errors (#5146)
* Potential fix for bug #5145 to suppress any errors, e.g. if feature is already activated * Mark Force as obsolete and remove Force and Sandboxed parameters from documentation --------- Co-authored-by: Gautam Sheth <gautamdsheth@outlook.com>
1 parent d470903 commit 7f2dd52

File tree

2 files changed

+1
-37
lines changed

2 files changed

+1
-37
lines changed

documentation/Enable-PnPFeature.md

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,6 @@ This will enable the feature with the id "99a00f6e-fb81-4dc7-8eac-e09c6f9132fe"
3434

3535
### EXAMPLE 2
3636
```powershell
37-
Enable-PnPFeature -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe -Force
38-
```
39-
40-
This will enable the feature with the id "99a00f6e-fb81-4dc7-8eac-e09c6f9132fe" with force.
41-
42-
### EXAMPLE 3
43-
```powershell
4437
Enable-PnPFeature -Identity 99a00f6e-fb81-4dc7-8eac-e09c6f9132fe -Scope Web
4538
```
4639

@@ -62,20 +55,6 @@ Accept pipeline input: False
6255
Accept wildcard characters: False
6356
```
6457
65-
### -Force
66-
Specifies whether to overwrite an existing feature with the same feature identifier. This parameter is ignored if there are no errors.
67-
68-
```yaml
69-
Type: SwitchParameter
70-
Parameter Sets: (All)
71-
72-
Required: False
73-
Position: Named
74-
Default value: None
75-
Accept pipeline input: False
76-
Accept wildcard characters: False
77-
```
78-
7958
### -Identity
8059
The id of the feature to enable.
8160
@@ -90,20 +69,6 @@ Accept pipeline input: True (ByValue)
9069
Accept wildcard characters: False
9170
```
9271
93-
### -Sandboxed
94-
Specify this parameter if the feature you're trying to activate is part of a sandboxed solution.
95-
96-
```yaml
97-
Type: SwitchParameter
98-
Parameter Sets: (All)
99-
100-
Required: False
101-
Position: Named
102-
Default value: None
103-
Accept pipeline input: False
104-
Accept wildcard characters: False
105-
```
106-
10772
### -Scope
10873
Specify the scope of the feature to activate, either Web or Site. Defaults to Web.
10974
@@ -119,8 +84,6 @@ Accept pipeline input: False
11984
Accept wildcard characters: False
12085
```
12186
122-
123-
12487
## RELATED LINKS
12588
12689
[Microsoft 365 Patterns and Practices](https://aka.ms/m365pnp)

src/Commands/Features/EnableFeature.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public class EnableFeature : PnPWebCmdlet
1111
[Parameter(Mandatory = true, Position = 0, ValueFromPipeline = true)]
1212
public Guid Identity;
1313

14+
[Obsolete("The Force parameter is obsolete and will be removed in future versions. Please update your scripts accordingly.")]
1415
[Parameter(Mandatory = false)]
1516
public SwitchParameter Force;
1617

0 commit comments

Comments
 (0)