Skip to content

[BUG] Enable-PnPFeature ignore -Force parameter #5145

@stevebeauge

Description

@stevebeauge

Reporting an Issue or Missing Feature

Reporting an issue

Expected behavior

Calling Enable-PnPFeature with the -Force parameter should not fail

Actual behavior

If the feature is already activated, the command fails:

Enable-PnPFeature: c:\some\path\script.ps1:168:3
Line |
 168 |    Enable-PnPFeature -Identity $FeatureTaxonomy -Scope Site -Force -Co …
     |    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Feature was already activated (Parameter 'id')

Steps to reproduce behavior

$siteConn = Connect-PnPOnline -Url $SiteUrl -ReturnConnection -ClientId:XXXX -Interactive -PersistLogin
$FeatureTaxonomy = "73ef14b1-13a9-416b-a9b5-ececa2b0604c" 
Enable-PnPFeature -Identity $FeatureTaxonomy -Scope Site -Force -Connection $siteConn

What is the version of the Cmdlet module you are running?

3.1.0

Which operating system/environment are you running PnP PowerShell on?

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions