注: PowerShellとの連携には、ShareGate MigrateのProまたはEnterpriseサブスクリプションが必要です。Essentialsプランでは利用できません。
コマンド
Import-GoogleDriveDocument
説明
Google Driveのドキュメントを SharePoint ライブラリにインポートするコマンドです。
注: 既定ではInsane modeが使用されるため(-NormalMode を指定した場合を除く)、このコマンドはMicrosoft 365のAzureインポートが完了するまで待ってから結果を返します。ローカル処理の完了後すぐに制御を返したい場合は、代わりに -NoWaitForImportCompletion を使用してください。その場合、返される結果は暫定的なものであり、インポートの内容はまだ反映されていません。インポートが実際に完了したタイミングを確認するには、Wait-ImportCompletion を使用するか、現在のPowerShellセッションを起動したままにしてください。以前の -WaitForImportCompletion スイッチは、完了を待つ動作が再び既定の挙動になったため、非推奨となりました。
ヒント:
Import-GoogleDriveDocumentスクリプトを増分移行用に調整する方法については、PowerShell で増分移行を実行するを参照してください。利用可能なコピーオプションについては、PowerShell のコピー オプションを参照してください。
例
すべてのドキュメントをインポートする。
$googleDrive = Connect-GoogleApiUser -Email [email protected]
$dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite"
$dstList = Get-List -Name "mydstlib" -Site $dstSite
Import-GoogleDriveDocument -GoogleDrive $googleDrive -DestinationList $dstList
管理者モードで、別のユーザーのすべてのドキュメントをインポートする。
$googleDrive = Connect-GoogleApiUser -Email [email protected] -Admin
Import-GoogleDriveDocument -GoogleDrive $googleDrive -UserEmail [email protected] -DestinationList $dstList
コピー元とコピー先のフォルダーを指定する。
Import-GoogleDriveDocument -GoogleDrive $googleDrive -SourceFolder "MyFolder/DocumentsToImport" -DestinationList $dstList -DestinationFolder "MyFolder/MySubFolder"
プロパティ テンプレートを使用してドキュメントをインポートする。
$propertyTemplate = New-PropertyTemplate -AuthorsAndTimestamps -VersionHistory -Permissions -NoLinkCorrection -FlattenFolders -VersionLimit 5 -CheckInAs Publish -ContentApproval SameAsCurrent -From 2012-01-01 -To 2012-12-31
$googleDrive = Connect-GoogleApiUser -Email [email protected]
Import-GoogleDriveDocument -GoogleDrive $googleDrive -SourceFolder "MyFolder/DocumentsToImport" -DestinationList $dstList -Template $propertyTemplate
プロパティ マッピングを使用してドキュメントをインポートする。
$mappings = Get-PropertyMapping -GoogleDrive $googleDrive -DestinationList $dstList
$mappings = Set-PropertyMapping -MappingSettings $mappings -Source "CustomData1" -Destination "CustomData1"
Import-GoogleDriveDocument -GoogleDrive $googleDrive -DestinationList $dstList -MappingSettings $mappings
すべてのドキュメントをインポートする前に、事前チェックを実行する。
Import-GoogleDriveDocument -GoogleDrive $googleDrive -DestinationList $dstList -WhatIf
Microsoft 365のAzureインポートの完了を待たずにドキュメントをインポートし、その後 Wait-ImportCompletion を使用して完了のタイミングを確認する。
$googleDrive = Connect-GoogleApiUser -Email [email protected]
$dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite"
$dstList = Get-List -Name "mydstlib" -Site $dstSite
Import-GoogleDriveDocument -GoogleDrive $googleDrive -DestinationList $dstList -NoWaitForImportCompletion
Wait-ImportCompletion
構文
Import-GoogleDriveDocument
-GoogleDrive <GoogleDriveInfo>
-DestinationList <List>
[-UserEmail <String>]
[-DestinationFolder <Uri>]
[-SourceFolder <Uri>]
[-TemplateName <String>]
[-NormalMode <SwitchParameter>]
[-NoWaitForImportCompletion <SwitchParameter>]
[-WhatIf <SwitchParameter>]
[-CopySettings <CopySettings>]
[-MappingSettings <MappingSettings>]
[-TaskName <String>]
Import-GoogleDriveDocument
-GoogleDrive <GoogleDriveInfo>
-DestinationList <List>
-Template <PropertyTemplate>
[-UserEmail <String>]
[-DestinationFolder <Uri>]
[-SourceFolder <Uri>]
[-NormalMode <SwitchParameter>]
[-NoWaitForImportCompletion <SwitchParameter>]
[-WhatIf <SwitchParameter>]
[-CopySettings <CopySettings>]
[-MappingSettings <MappingSettings>]
[-TaskName <String>]
パラメーター
-CopySettings <CopySettings>
コピー設定を指定します。
必須かどうか | False |
既定値 | None |
パイプライン入力を許可するか | True (ByValue; ByPropertyName) |
ワイルドカード文字を許可するか | False |
パラメーターセット名 | (All) |
エイリアス | None |
-DestinationFolder <Uri>
移行先のフォルダーパスを指定します。注: このパラメーターは、移行先に新しいフォルダーを作成するために使用することはできません。
必須かどうか | False |
既定値 | None |
パイプライン入力を許可するか | False |
ワイルドカード文字を許可するか | False |
パラメーターセット名 | (All) |
エイリアス | None |
-DestinationList <List>
移行先のリストを指定します。
必須かどうか | True |
既定値 | None |
パイプライン入力を許可するか | True (ByValue; ByPropertyName) |
ワイルドカード文字を許可するか | False |
パラメーターセット名 | (All) |
エイリアス | None |
-GoogleDrive <GoogleDriveInfo>
コピー元のGoogle Driveを指定します。
必須かどうか | True |
既定値 | None |
パイプライン入力を許可するか | True (ByValue; ByPropertyName) |
ワイルドカード文字を許可するか | False |
パラメーターセット名 | (All) |
エイリアス | None |
-MappingSettings <MappingSettings>
マッピング設定を指定します。
必須かどうか | False |
既定値 | None |
パイプライン入力を許可するか | False |
ワイルドカード文字を許可するか | False |
パラメーターセット名 | (All) |
エイリアス | None |
-NormalMode <SwitchParameter>
通常モードを使用することを指定します。注: PowerShellでは、既定で常に Insane mode が使用されます。
必須かどうか | False |
既定値 | None |
パイプライン入力を許可するか | False |
ワイルドカード文字を許可するか | False |
パラメーターセット名 | (All) |
エイリアス | None |
-NoWaitForImportCompletion <SwitchParameter>
ローカル処理の完了後、AzureのInsane modeインポートの完了を待たずに、コマンドが値を返すことを指定します。
必須かどうか | False |
既定値 | None |
パイプライン入力を許可するか | False |
ワイルドカード文字を許可するか | False |
パラメーターセット名 | (All) |
エイリアス | None |
-SourceFolder <Uri>
コピー元のフォルダーパスを指定します。
必須かどうか | False |
既定値 | None |
パイプライン入力を許可するか | False |
ワイルドカード文字を許可するか | False |
パラメーターセット名 | (All) |
エイリアス | None |
-TaskName <String>
タスクの名前を指定します。
必須かどうか | False |
既定値 | None |
パイプライン入力を許可するか | False |
ワイルドカード文字を許可するか | False |
パラメーターセット名 | (All) |
エイリアス | None |
-Template <PropertyTemplate>
プロパティ テンプレートを指定します。組み込みの「Full copy」テンプレートを使用する場合は、このパラメーターを指定しないでください。
必須かどうか | False |
既定値 | None |
パイプライン入力を許可するか | False |
ワイルドカード文字を許可するか | False |
パラメーターセット名 | Template |
エイリアス | None |
-TemplateName <String>
名前を指定して、使用するプロパティ テンプレートを指定します。ShareGateを使用すると、指定したリストのプロパティ テンプレートを構成できます(「Import Property Mapping」または「New-PropertyTemplate」を参照)。組み込みの「Full copy」テンプレートを使用する場合は、このパラメーターを指定しないでください。
必須かどうか | False |
既定値 | None |
パイプライン入力を許可するか | False |
ワイルドカード文字を許可するか | False |
パラメーターセット名 | Default |
エイリアス | None |
-UserEmail <String>
移行元となるユーザーアカウントを指定します。このパラメーターを設定しない場合、ログインしているユーザーのファイルがインポートされます。このパラメーターを使用するには、管理者として接続している必要があります。
必須かどうか | False |
既定値 | None |
パイプライン入力を許可するか | True (ByValue; ByPropertyName) |
ワイルドカード文字を許可するか | False |
パラメーターセット名 | (All) |
エイリアス | None |
-WhatIf <SwitchParameter>
移行の代わりに事前チェックを実行することを指定します。詳細については、「PowerShell で What If を使って事前チェックを実行する」を参照してください。
必須かどうか | False |
既定値 | None |
パイプライン入力を許可するか | False |
ワイルドカード文字を許可するか | False |
パラメーターセット名 | (All) |
エイリアス | None |
この記事はAIによって翻訳されています。ご不明な点がある場合は、英語の原文をご確認ください。
