$sourceWeb = Get-SPWeb http://34.231.97.77
#$xmlFilePath = “C:\Install\ScriptDocument.xml”
Function BackupCType()
{
param ($CTypeName, $xmlFilePath)
#Create Export File
New-Item $xmlFilePath -type file -force
#Export Content Types to XML file
Add-Content $xmlFilePath “<?xml version=`”1.0`” encoding=`”utf-8`”?>”
Add-Content $xmlFilePath “`n<ContentTypes>”
$sourceWeb.ContentTypes | ForEach-Object {
write-host $_.Group
if ($_.Group -eq $CTypeName) {
Add-Content $xmlFilePath $_.SchemaXml
}
}
Add-Content $xmlFilePath “</ContentTypes>”
$sourceWeb.Dispose()
}
BackupCType “Allied World Content Types” “C:\Install\ScriptDocument.xml”