Cli-microsoft365: Add 'spo contenttype remove' command

Created on 2 Apr 2019  路  8Comments  路  Source: pnp/cli-microsoft365

Summary

Allow to remove an existing Content Type of the specified SharePoint site.

Usage

The cmdlet should like:

spo contenttype remove --webUrl https://contoso.sharepoint.com/sites/project-x --id '0x000234567890'

_Delete a Content Type by ID_

spo contenttype remove --webUrl https://contoso.sharepoint.com/sites/project-x --name 'My Custom Content Type'

_Delete a Content Type by name_

spo contenttype remove --webUrl https://contoso.sharepoint.com/sites/project-x --name 'My Custom Content Type' --confirm

_Delete a Content Type by name without confirmation prompt_

Use cases

  • If the content type is used by one or more SharePoint lists, the content type cannot be delete (return error message. This is the default behavior of SharePoint)
  • The fields linked to the deleted Content Type have to stay
  • If the Content Type does not exist, return an error
  • If the Content Type exists and if it is not used by one or more SharePoint list, it can be delete

Options

The following options of the cmdlet have to be supported:

  • [ ] -u, --webUrl Web URL
  • [ ] --name name of the content type (Specify either name or id but not both)
  • [ ] --id id of the content type (Specify either name or id but not both)
  • [ ] --confirm (to suppress prompt)
  • [ ] -o, --output
  • [ ] --verbose
  • [ ] --debug

To Do

  • [ ] Add the command to the solution
  • [ ] Add the documentation of usage (MkDocs)
  • [ ] Validate cmdlet usage
  • [ ] Validate Unit tests

Additional informations


Expand for output related informations
No additional information

good first issue new feature work in progress

All 8 comments

Nice suggestion! Please, write a spec for it and we're taking it from there 馃憦

Ok, that's wrote, check if that sound good for you 馃槈

Let's change title to name. Other than that, good to go 馃挭

Ok, done

I was wondering if I could try taking this on if someone isn't already working on it.

Ok for me, you can take it 馃槈

Hi @DaveCalGH, feel free to take it.

Appreciate your help @DaveCalGH. Please, don't hesitate to reach out if you have any questions.

Was this page helpful?
0 / 5 - 0 ratings