Skip to main content
Import-PropertyMapping

Import property mappings from an SGPM file with PowerShell

Updated this week

Command

Import-PropertyMapping

Details

The command to import the property mappings from a file.

Examples

Import mappings from file

# Import property mappings from a file
$mappingSettings = Import-PropertyMapping -Path "C:\MyMappings\MyPropertyMappingsFileName.sgpm"

# Display the imported 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 :

Merge mappings with mappings from file

# Set an initial property mapping for multiple source columns to a single destination column
$mappingSettings = Set-PropertyMapping -Source Col1,Col2,Col3 -Destination "Multiple Column"

# Import additional property mappings from a file and merge with the existing settings
$mappingSettings = Import-PropertyMapping -MappingSettings $mappingSettings -Path "C:\MyMappings\MyPropertyMappingsFileName.sgpm"

# Display the updated property mappings
$mappingSettings

# Example output:
# PropertyMappings : Author -> Author
# KEY Created -> Created
# Editor -> Editor
# Modified -> Modified
# Col1 -> Multiple Column
# Col2 -> ────────┘
# Col3 -> ────────┘
# MyCustomField -> MyCustomField
# KEY Title -> Title
# ContentTypeMappings :
# UserAndGroupMappings :
# PermissionLevelMappings :
# SiteTemplateMappings :

Syntax

Import-PropertyMapping-Path <String>
[-MappingSettings <MappingSettings>]

Parameters

-MappingSettings <MappingSettings>

Specifies the mapping settings. This command adds multiple mapping settings to an existing mapping settings object. For more details, see Use multiple mapping files at once.

Required?

False

Default value

None

Accept pipeline input?

True (ByValue, ByPropertyName)

Accept wildcard characters?

False

Parameter set name

(All)

Aliases

None

-Path <String>

Specifies the file path that was previously exported with Sharegate.

Required?

True

Default value

None

Accept pipeline input?

False

Accept wildcard characters?

False

Parameter set name

(All)

Aliases

PSPath

Did this answer your question?