powershell icon indicating copy to clipboard operation
powershell copied to clipboard

[BUG] Multiple Feature Management Cmdlets Return a Stock Error (ex. Get-PnPFeature, Enable-PnPFeature)

Open andrewhelsel24-glitch opened this issue 7 months ago • 0 comments

###Issue Description:

The issue I'm having started near the beginning of August. I have been utilizing the PnPOnline module to enable and check status of various features on multiple sites. It had been working well for the most part, but between one run and the next, using the same script, I started receiving an error for any feature management cmdlet that I run.

###Expected Behavior:

Using Enable-PnPFeature as an example, I expect this cmdlet to enable the feature on the site I'm connected to. Example script is below:


Connect-PnPOnline -Url "SiteURL" -interactive -clientid "ClientId" $featureId = "FeatureId" Enable-PnPFeature -Identity $featureId -Scope web -Force Start-Sleep -Seconds 5 $feature2 = Get-PnPFeature -Identity $featureId -Scope web -ErrorAction Continue If ($feature2 -ne $null) {Write-Host "Feature successfully enabled"} Else {Write-Host "Feature failed to enable"} Start-Sleep -Seconds 10

The expected behavior here is that the feature would be enabled by Enable-PnPFeature, then get

Actual behavior

In the screenshot below, I just ran Get-PnPFeature to display the code. This error pops up with any iteration of Get-PnPFeature, Enable-PnPFeature and Disable-PnPFeature. The only command I've utilized in PnP that works since this issue started is Get-PnPContext.

Image

Steps to reproduce behavior

Connect-PnPOnline to any site, then run Get-PnPFeature, Enable-PnPFeature or Disable-PnPFeature (with required parameters). It returns this error every time.

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

I've tried multiple, but currently I'm using 3.1.117-nightly.

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

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

Troubleshooting attempted:

I have uninstalled and reinstalled Powershell entirely, tried various versions of Powershell 7, as well as various versions of the PnPOnline module. I have removed and re-added the app registration numerous times. I've verified that all necessary permissions and admin consents are granted. Again, this was working between one run and the next and just stopped at random and hasn't worked since. I also had a colleague try it on his computer. We got the same behavior.

andrewhelsel24-glitch avatar Aug 27 '25 14:08 andrewhelsel24-glitch