Command
Save-PropertyMapping
Description
The command to save all the property mappings for a specific source and destination list.
Examples
Save custom mappings for a source list and a destination list
# Connect to the source and destination sites
$srcSite = Connect-Site -Url "http://myfarm1/sites/mysourcesite"
$dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite"
# Get the source list from the source site
$srcList = Get-List -Name "mysrclist" -Site $srcSite
# Get the destination list from the destination site
$dstList = Get-List -Name "mydstlist" -Site $dstSite
# Retrieve existing property mappings between the source and destination lists
$mappingSettings = Get-PropertyMapping -SourceList $srcList -DestinationList $dstList
# Display the current property mappings
$mappingSettings
# Example output:
# PropertyMappings : Author -> Author
# KEY Created -> Created
# Editor -> Editor
# Modified -> Modified
# <NO SOURCE> -> MultipleColumn
# MyCustomField -> MyCustomField
# KEY Title -> Title
# ContentTypeMappings :
# UserAndGroupMappings :
# PermissionLevelMappings :
# SiteTemplateMappings :
# Add a new property mapping for multiple source columns to a single destination column
$mappingSettings = Set-PropertyMapping -MappingSettings $mappingSettings -Source Col1,Col2,Col3 -Destination MultipleColumn
# Save the updated property mappings back to the source and destination lists
$mappingSettings = Save-PropertyMapping -MappingSettings $mappingSettings -SourceList $srcList -DestinationList $dstList
# Retrieve the updated property mappings to verify the changes
$mappingSettings = Get-PropertyMapping -SourceList $srcList -DestinationList $dstList
# Display the updated property mappings
$mappingSettings
# Example output:
# PropertyMappings : Author -> Author
# KEY Created -> Created
# Editor -> Editor
# Modified -> Modified
# Col1 -> MultipleColumn
# Col2 -> ───────┘
# Col3 -> ───────┘
# MyCustomField -> MyCustomField
# KEY Title -> Title
# ContentTypeMappings :
# UserAndGroupMappings :
# PermissionLevelMappings :
# SiteTemplateMappings :
Syntax
Save-PropertyMapping-MappingSettings <MappingSettings> -SourceList <List> -DestinationList <List>
Save-PropertyMapping-MappingSettings <MappingSettings> -FromFileSystem <SwitchParameter> -DestinationList <List>
Parameters
-DestinationList <List>
Specifies the destination list.
Required? | True |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-FromFileSystem <SwitchParameter>
Specifies that the source is the file system.
Required? | True |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | FileSystem |
Aliases | None |
-MappingSettings <MappingSettings>
Specifies the mapping settings.
Required? | True |
Default value | None |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-SourceList <List>
Specifies the source list.
Required? | True |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | Default |
Aliases | None |