Unable to handle action addContentType. No action handler was registered for this action.
Category
- [ ] Question
- [ ] Typo
- [x] Bug
- [ ] Additional article idea
Expected or Desired Behavior
I expect when I use the addContentType verb in a json schema I can add it to a site script.
Observed Behavior
When using the Add-SPOSiteScript or Add-PnPSiteScript cmdlets I am getting the "Unable to handle action addContentType" error. I am using SharePointPnPPowerShellOnline version 2.24.1803.0 and Microsoft.Online.SharePoint.PowerShell version 16.0.7414.0 on a Targeted Release tenant.
Steps to Reproduce
- Create a script for the addContentType action
PS C:\> $script = @'
>> {
>> "$schema": "schema.json",
>> "actions": [
>> {
>> "verb": "addContentType",
>> "name": "MyFirstContentType"
>> }
>> ],
>> "bindata": { },
>> "version": 1
>> };
>> '@
- Add the json action to a site script via SPO PowerShell
PS C:\> Add-SPOSiteScript -Title "Add Content Type Site Script" -Description
"Content Type Script" -Content $script
The result of this script is the following error: Unable to handle action addContentType. No action handler was registered for this action.

It looks like this is a case of RTFM ;)
When using existing content types and using it as subaction in a list it works.
That's correct - but we have some updates on content types that we'll share next week. Thanks!
Is the issue as been fixed ? I have the same error with the remove content type verb. Add-SPOSiteScript : Unable to handle action removeContentType. No action handler was registered for this action. At line:1 char:51
- ... teScriptFile -Raw | Add-SPOSiteScript -Title $siteScriptTitle) | Sele ...
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~- CategoryInfo : NotSpecified: (:) [Add-SPOSiteScript], ServerException
- FullyQualifiedErrorId : Microsoft.SharePoint.Client.ServerException,Microsoft.Online.SharePoint.PowerShell.AddSPOSiteScript
Please let me know, Thanks.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues