Introduction
According to Microsoft, A content type is a reusable collection of metadata (columns), workflow, behavior, and other settings for a category of items or documents in a Microsoft SharePoint Foundation 2010 list or document library. Content types enable you to manage the settings for a category of information in a centralized, reusable way.
Here I'm assuming that you have content type hub already setup at your end. For more information on how to setup content type hub please find this link ( http://sharepoint-community.net/profiles/blogs/understanding-content-type-hub-cth-in-sharepoint-2013 ).
Information :
Please find below is the powershell script which will help you publish the content type.
- $CTHubURL = "{<Content Type Hub Setup URL>E.g. http://mySharePointSite :1111/}"
- #Get Content Type site and web objects
- $ctHubSite = Get-SPSite $CTHubURL
- $ctHubWeb = $ctHubSite.RootWeb
-
- #Check the site is a content type hub
- if ([Microsoft.SharePoint.Taxonomy.ContentTypeSync.ContentTypePublisher]::IsContentTypeSharingEnabled($ctHubSite))
- {
- #Set up ContentTypePublisher object to allow publishing through the Content Type Hub site
- $spCTPublish = New-Object Microsoft.SharePoint.Taxonomy.ContentTypeSync.ContentTypePublisher ($ctHubSite)
-
- #Step through each content type in the content type hub
- $ctHubWeb.ContentTypes | Sort-Object Name | ForEach-Object {
-
- #Has the content type been published?
- if ($spCTPublish.IsPublished($_))
- {
- #Republish content type
- $spCTPublish.Publish($_)
- write-host "Content type" $_.Name "has been republished" -foregroundcolor Green
- }
- else
- {
- write-host "Content type" $_.Name "is not a published content type"
- }
- }
- }
- else
- {
- write-host $CTHubURL "is not a content type hub site."
- }
- #Dispose of site and web objects
- $ctHubWeb.Dispose()
- $ctHubSite.Dispose()