Command
Import-PermissionLevelMapping
Description
The command to import the permission level mappings from a file.
Examples
Import mappings from file
# Import permission level mappings from the specified file
$mappingSettings = Import-PermissionLevelMapping -Path "C:\MyMappings\MyPermissionLevelMappingsFileName.sgrm"
# Display the imported mappings
$mappingSettings
# Output:
# PropertyMappings :
# ContentTypeMappings :
# UserAndGroupMappings :
# PermissionLevelMappings : Approve -> Approve
# Contribute -> Contribute
# Design -> Design
# Full Control -> Full Control
# My Custom Permission -> <NO DESTINATION>
# Read -> Read
# View Only -> View Only
# SiteTemplateMappings :
Merge mappings with mappings from file
# Map "My Custom Permission" to "Full Control"
$mappingSettings = Set-PermissionLevelMapping -Source "My Custom Permission" -Destination "Full Control"
# Import additional permission level mappings from the specified file, merging with the current settings
$mappingSettings = Import-PermissionLevelMapping -MappingSettings $mappingSettings -Path "C:\MyMappings\MyPermissionLevelMappingsFileName.sgrm"
# Display the final permission level mappings
$mappingSettings
# Output:
# PropertyMappings :
# ContentTypeMappings :
# UserAndGroupMappings :
# PermissionLevelMappings : Approve -> Approve
# Contribute -> Contribute
# Design -> Design
# Full Control -> Full Control
# My Custom Permission -> Full Control
# Read -> Read
# View Only -> View Only
# SiteTemplateMappings :
Syntax
Import-PermissionLevelMapping-Path <String> [-MappingSettings <MappingSettings>]
Parameters
-MappingSettings <MappingSettings>
Specifies the mapping settings. Use this command to add 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 |