Skip to main content
Export Property Mapping
Updated this week

Command

Export-PropertyMapping

Description

The command to export the property mappings to a file.

Examples

Export custom mappings

# Set the initial property mapping
# Map "My Old Title" from the source to "Title" in the destination
$mappingSettings = Set-PropertyMapping -Source "My Old Title" -Destination "Title"

# Add a property mapping for multiple source columns to a single destination column
# Map "Col1", "Col2", and "Col3" to "MultipleColumn"
$mappingSettings = Set-PropertyMapping -MappingSettings $mappingSettings -Source Col1,Col2,Col3 -Destination "MultipleColumn"

# Add a property mapping for a custom field
# Map "SourceCustomField" to "MyCustomField"
$mappingSettings = Set-PropertyMapping -MappingSettings $mappingSettings -Source "SourceCustomField" -Destination "MyCustomField"

# Export the property mappings to a file
# The mappings will be saved in the specified file path
Export-PropertyMapping -MappingSettings $mappingSettings -Path "C:\MyMappings\MyPropertyMappingsFileName"

# Output message confirming successful export
# Example output:
# The property mappings exported with success to: C:\MyMappings\MyPropertyMappingsFileName.sgpm

Export mappings from 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"

# Retrieve the source list from the source site
$srcList = Get-List -Name "mysrclist" -Site $srcSite

# Retrieve 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

# Export the retrieved property mappings to a file
Export-PropertyMapping -MappingSettings $mappingSettings -Path "C:\MyMappings\MyPropertyMappingsFileName"

# Example output message
# The property mappings exported with success to: C:\MyMappings\MyPropertyMappingsFileName.sgpm

Syntax

Export-PropertyMapping-MappingSettings <MappingSettings>
[-Path <String>]
[-Overwrite <SwitchParameter>]

Parameters

-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

-Overwrite <SwitchParameter>

Specifies the file will be overwritten if already exist.

Required?

False

Default value

None

Accept pipeline input?

False

Accept wildcard characters?

False

Parameter set name

(All)

Aliases

None

-Path <String>

Specifies the path where you want to save the file.

Required?

False

Default value

None

Accept pipeline input?

False

Accept wildcard characters?

False

Parameter set name

(All)

Aliases

PSPath

Did this answer your question?