I have a type of content that will not go away. I tried messing around with the function that installed it (reinstalling, deactivating, retracting, etc.), to no avail. Finally, here is a PowerShell attempt that eloquently illustrates the problem:
PS C:\Users\Administrator> $web = get-spweb http:
$ct = $web.ContentTypes["Timed Activity"]
$u = [Microsoft.SharePoint.SPContentTypeUsage]::GetUsages($ct)
if ($u.Count > 0) {
foreach ($usage in $u) {
Write-Output ("The content type is used here: {0}",$usage)
}
} else {
$ct.Delete()
$web.Update()
}
Exception calling "Delete" with "0" argument(s): "The content type "Timed Activity" is part of an application feature."
At line:10 char:13
+ $ct.Delete <<<< ()
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
Does anyone know what I can do about it? I am developing a solution with the types of content it contains, and I cannot make changes because it cannot backtrack properly and subsequent deployment is not performed.
source
share