NAME
Set-ContentTypeMapping
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>]
DESCRIPTION
The command to add or update a content type mapping in the mapping settings.
PARAMETERS
-Destination <String>
Specifies the destination content type.
Required? | True |
Position? | 2 |
Default value | |
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 |
Position? | 1 |
Default value | |
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 |
Position? | 1 |
Default value | |
Accept pipeline input? | false |
Accept wildcard characters? | False |
Parameter set name | DefaultFolderContentType |
Aliases | None |
-Ignore <SwitchParameter>
Specifies to ignore the content type.
Required? | True |
Position? | 2 |
Default value | |
Accept pipeline input? | false |
Accept wildcard characters? | False |
Parameter set name | ExplicitIgnoreDestination |
Aliases | None |
-MappingSettings <MappingSettings>
Specifies the mapping settings.
Required? | False |
Position? | 0 |
Default value | |
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 |
Position? | 1 |
Default value | |
Accept pipeline input? | false |
Accept wildcard characters? | False |
Parameter set name | Default, ExplicitIgnoreDestination |
Aliases | None |
INPUTS
MappingSettings
OUTPUTS
MappingSettings
The resulting mapping settings after the operation.
EXAMPLES
-------------- Example: 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 $mappingSettings PropertyMappings : ContentTypeMappings : Image -> Picture My Custom Content Type -> <NO DESTINATION> Video -> Movie UserAndGroupMappings : PermissionLevelMappings : SiteTemplateMappings :
-------------- Example: 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 $mappingSettings PropertyMappings : ContentTypeMappings : Audio -> Audio Basic Page -> <NO DESTINATION> Document -> Document Folder -> Folder Image -> Picture My Custom Content Type -> <NO DESTINATION> Video -> Movie UserAndGroupMappings : PermissionLevelMappings : SiteTemplateMappings :
-------------- Example: Set content type mappings from local disk storage --------------
$mappingSettings = Set-ContentTypeMapping -FileFromFileSystem -Destination "CustomFileContentType" $mappingSettings = Set-ContentTypeMapping -FolderFromFileSystem -Destination "CustomFolderContentType" -MappingSettings $mappingSettings $mappingSettings PropertyMappings : ContentTypeMappings : <File> -> CustomFileContentType <Folder> -> CustomFolderContentType UserAndGroupMappings : PermissionLevelMappings : SiteTemplateMappings :