Skip to content

Add 'spo contenttype remove' command #904

@Laul0

Description

@Laul0

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions