3

I'm trying to hide (or remove it from the new button drop) a SPContentType that is already in use via Powershell scripting.

Even if before:

$SPContentType.Hidden = $true
$SPContentType.Update()

I run:

$SPContentType.ReadOnly = $false
$SPContentType.Sealed = $false
$SPContentType.Update()

The exception error message "Content Type in use" is always throw.

Ideas? Is possible to hide an CTyte that's in use?

1

this should do a trick:

// Hide old content types.
$SPContentType.Group = "_Hidden";
$SPContentType.Update();

This will hide ContentType from Site settings but will leave it for all lists and libraries using it in order to save compatibility.

You can find best practices how to manage content types here.

Hope it helps,

Andrew

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.