SP 2010 Disabling site Publishing Feature = Fail

14 06 2012

So here I am, trying to figure out how to create a page template. Of course SharePoint doesn’t like you to save things as templates if you have the publishing feature turned on ( i knew why, but the momentary laps in judgement due to my add, made me forget). So what do I do? Like a total noob, i go and disable publshing feature.
No Suup forrr JU! – soup nazi.
Errors all over the place. So naturally I said oops and tried to re enable it. It doesn’t scream at me.
But alas, the New Page Button is gone from the site actions menu.
Minor inconvenience i guess…but no it isn’t. There is more. I navigate to the Pages library to confirm its still there and it is. So i decide to create a new page and it does. But when i try to check it in i get:
-Invalid SPListItem. The SPListItem provided is not compatible with a Publishing Page.- And a bunch of red /.

Panic starts to set it.

But then I remembered something Yoda once said. Ok there are many things Yoda said that apply here, but none rang more true than:

May the Force be with you.

Powershell is a life saver. I did a quick search on syntax and ran these very commands:

PS C:\Users\spfarmadmin>Disable-spfeature Publishing -url http://yoursite/subsite -force

PS C:\Users\spfarmadmin> Enable-spfeature Publishing -url http://yoursite/subsite -force


Everything is back to normal. New Page button is back.

Now if i can only -force myself to stop doing stupid things in SharePoint, I would be set.

But then you guys wouldn’t have anything to read about.