メインコンテンツにスキップ

Export-PropertyMapping

注: PowerShellとの連携には、ShareGate MigrateのProまたはEnterpriseサブスクリプションが必要です。Essentialsプランでは利用できません。

コマンド

Export-PropertyMapping

説明

プロパティ マッピングをファイルにエクスポートするコマンドです。

カスタム マッピングをエクスポートする

# 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

移行元リストと移行先リストからマッピングをエクスポートする

# 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

構文

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

パラメーター

-MappingSettings <MappingSettings>

マッピング設定を指定します。

必須かどうか

True

既定値

None

パイプライン入力を許可するか

True (ByValue, ByPropertyName)

ワイルドカード文字を許可するか

False

パラメーターセット名

(All)

エイリアス

None

-Overwrite <SwitchParameter>

ファイルが既に存在する場合に上書きすることを指定します。

必須かどうか

False

既定値

None

パイプライン入力を許可するか

False

ワイルドカード文字を許可するか

False

パラメーターセット名

(All)

エイリアス

None

-Path <String>

ファイルの保存先パスを指定します。

必須かどうか

False

既定値

None

パイプライン入力を許可するか

False

ワイルドカード文字を許可するか

False

パラメーターセット名

(All)

エイリアス

PSPath

この記事はAIによって翻訳されています。ご不明な点がある場合は、英語の原文をご確認ください。

こちらの回答で解決しましたか?