开发者

Site Column Page Not Accessible

I accidentally created a field type called "Test" instead of Text using the following

Powershell command:

Get site and web object

$site = Get-SPSite -Identity "http://mysite/sites/.."
$web = $site.RootWeb 

#Assign fieldXML variable with XML string for site column
$fieldXML = '<Field Type="Test"...etc.

Poweshell threw the following error:

Exception calling "AddFieldAsXml" with "1" argument(s): "Field type Test is not installed properly. Go to the list settings开发者_StackOverflow page to delete this field. " At C:\Scripts\addsitecolumn.ps1:25 char:26 + $web.Fields.AddFieldAsXml <<<< ($fieldXML) + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : DotNetMethodException

Is there a Powershell command to delete the Test Field or is there a way to get to this fields 'hidded' page?


I ran into a similar problem today. I ran Sharepoint Manager 2010 and got the SchemaXML off from the site collection and found out that there were 3 site columns with nothing defined in it. I tried to remove it by powershell above with display name (which is "") or index, but none of that work as the item object see it as null. Then I came across this post:

https://sharepoint.stackexchange.com/questions/11945/error-message-field-type-publishing-image-is-not-installed-properly-go-to-the

Which remove it from the content database and that worked for me. Right after that I check the SchemaXML and the 3 strange site columns were removed. It's interesting how the content type table ties directly into this problem.


Try this in PowerShell:

$web1 = Get-SPWeb "http://testWeb"
$field = $web1.Fields["Test 1"]
$field.Delete()

"Test 1" is the Display name of the field you tried to add earlier.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜