I've created a list in sharepoint by using visualstudio. The List is based on a custom contenttype. Because I want to delete the title field I've switched off inheritation of the Contenttype:
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<Field ID="{51CC6776-F855-48d5-A4EC-B7CE11CE2324}"
DisplayName="ExpiresDate" Name="ExpiresDate"
Type="DateTime" Required="False"
UnlimitedLengthInDocumentLibrary="FALSE"/>
<!-- Parent ContentType: Element (0x01) -->
<ContentType ID="0x0100b48c62c42879472aa8f1e1afc4dba7ce"
Name="GroupsList - ContentTypeGroups"
Group="Custom Content Types"
Description="My Content Type"
Inherits="false"
Version="0">
<FieldRefs>
<RemoveFieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" />
<FieldRef ID="{51CC6776-F855-48d5-A4EC-B7CE11CE2324}" Name="ExpiresDate" Required="FALSE" ShowInNewForm="FALSE" ShowInEditForm="FALSE" />
</FieldRefs>
</ContentType>
</Elements>
Now I wanted to read out the fields content via powershell:
$site = New-Object Microsoft.SharePoint.SPSite($GroupListURL)
$web = $site.OpenWeb()
$list = $web.Lists[$GroupListName]
$items = $list.Items
$listitem = $list.Items.GetItemByID($ItemID)
$ExpiresDate = $listitem["ExpiresDate"]
But I'm only get Null for ExpiresDate. If I set inheritation to true I get ExpiresDates Value but the TitleField is still visible.
Does anyone know why?
$listitem.ContentTypeId
? In other words, are you sure the list item is using your custom content type?