PnP-PowerShell icon indicating copy to clipboard operation
PnP-PowerShell copied to clipboard

Remove-PnpContentTypeFromList not working on subsites

Open joefedorowicz opened this issue 8 years ago • 1 comments

###Notice: many issues / bugs reported are actually related to the PnP Core Library which is used behind the scenes. Consider carefully where to report an issue:###

  1. Are you using Apply-SPOProvisioningTemplate or Get-SPOProvisioningTemplate? The issue is most likely related to the Provisioning Engine. The Provisioning engine is not located in the PowerShell repo. Please report the issue here: https://github.com/officedev/PnP-Sites-Core/issues.
  2. Is the issue related to the cmdlet itself, its parameters, the syntax, or do you suspect it is the code of the cmdlet that is causing the issue? Then please continue reporting the issue in this repo.
  3. If you think that the functionality might be related to the underlying libraries that the cmdlet is calling (We realize that that might be difficult to determine), please first double check the code of the cmdlet, which can be found here: https://github.com/OfficeDev/PnP-PowerShell/tree/master/Commands. If related to the cmdlet, continue reporting the issue here, otherwise report the issue at https://github.com/officedev/PnP-Sites-Core/issues

Reporting an Issue or Missing Feature

Reporting an issue

Expected behavior

I expect the ContentType to be removed from the list, as if I did it in the UI

Actual behavior

Nothing, with no error.

Steps to reproduce behavior

On a subsite, I'm running the below command:

Remove-PnPContentTypeFromList -List $listName -ContentType $ctName

The prompt returns as if successful but the content type exists.

Which version of the PnP-PowerShell Cmdlets are you using?

  • [ ] PnP PowerShell for SharePoint 2013
  • [ ] PnP PowerShell for SharePoint 2016
  • [X ] PnP PowerShell for SharePoint Online

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

2 .25.1804 Rev 1

How did you install the PnP-PowerShell Cmdlets?

  • [ ] MSI Installed downloaded from GitHub
  • [X] Installed through the PowerShell Gallery with Install-Module
  • [ ] Other means

joefedorowicz avatar Apr 23 '18 18:04 joefedorowicz

I encounter the same problem but only if the list content type has been changed on the list level (i.e. renamed). If I set the name value of the content type to the same value as the parent, the cmdlet works.

ghost avatar Jun 25 '18 08:06 ghost