Command
Set-ContentTypeMapping
Description
The command to add or update a content type mapping in the mapping settings.
Index
Examples
Set custom mappings
$mappingSettings = Set-ContentTypeMapping -Source Image -Destination Picture $mappingSettings = Set-ContentTypeMapping -MappingSettings $mappingSettings -Source "Video" -Destination "Movie" $mappingSettings = Set-ContentTypeMapping -MappingSettings $mappingSettings -Source "My Custom Content Type" -Ignore $mappingSettingsPropertyMappings : ContentTypeMappings : Image -> Picture My Custom Content Type -> <NO DESTINATION> Video -> MovieUserAndGroupMappings : PermissionLevelMappings : SiteTemplateMappings :
Set custom mappings on existing mappings from a source list and a destination list
$srcSite = Connect-Site -Url "http://myfarm1/sites/mysourcesite" $dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite" $srcList = Get-List -Name mysrclist -Site $srcSite $dstList = Get-List -Name mydstlist -Site $dstSite $mappingSettings = Get-ContentTypeMapping -SourceList $srcList -DestinationList $dstList $mappingSettings = Set-ContentTypeMapping -MappingSettings $mappingSettings -Source "Image" -Destination "Picture" $mappingSettings = Set-ContentTypeMapping -MappingSettings $mappingSettings -Source "Video" -Destination "Movie" $mappingSettings = Set-ContentTypeMapping -MappingSettings $mappingSettings -Source "My Custom Content Type" -Ignore $mappingSettingsPropertyMappings : ContentTypeMappings : Audio -> Audio Basic Page -> <NO DESTINATION> Document -> Document Folder -> Folder Image -> Picture My Custom Content Type -> <NO DESTINATION> Video -> MovieUserAndGroupMappings : PermissionLevelMappings : SiteTemplateMappings :
Set content type mappings from local disk storage
$mappingSettings = Set-ContentTypeMapping -FileFromFileSystem -Destination "CustomFileContentType" $mappingSettings = Set-ContentTypeMapping -FolderFromFileSystem -Destination "CustomFolderContentType" -MappingSettings $mappingSettings $mappingSettingsPropertyMappings : ContentTypeMappings : <File> -> CustomFileContentType <Folder> -> CustomFolderContentTypeUserAndGroupMappings : PermissionLevelMappings : SiteTemplateMappings :
Syntax
Set-ContentTypeMapping-Source <String> -Destination <String> [-MappingSettings <MappingSettings>]
Set-ContentTypeMapping-Source <String> -Ignore <SwitchParameter> [-MappingSettings <MappingSettings>]
Set-ContentTypeMapping-FileFromFileSystem <SwitchParameter> -Destination <String> [-MappingSettings <MappingSettings>]
Set-ContentTypeMapping-FolderFromFileSystem <SwitchParameter> -Destination <String> [-MappingSettings <MappingSettings>]
Parameters
-Destination <String>
Specifies the destination content type.
Required? | True |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | Default, DefaultFileContentType, DefaultFolderContentType |
Aliases | None |
-FileFromFileSystem <SwitchParameter>
Specifies to set the default content type for files coming from the file system.
Required? | True |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | DefaultFileContentType |
Aliases | None |
-FolderFromFileSystem <SwitchParameter>
Specifies to set the default content type for folders coming from the file system.
Required? | True |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | DefaultFolderContentType |
Aliases | None |
-Ignore <SwitchParameter>
Specifies to ignore the content type.
Required? | True |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | ExplicitIgnoreDestination |
Aliases | None |
-MappingSettings <MappingSettings>
Specifies the mapping settings.
Required? | False |
Default value | None |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-Source <String>
Specifies the source content type.
Required? | True |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | Default, ExplicitIgnoreDestination |
Aliases | None |