Command
Import-GoogleDriveDocument
Description
The command to import Google Drive documents to a SharePoint library.
Tips:
- You will find how to adapt any Import-GoogleDriveDocument script to perform an incremental migration in the Incremental update using PowerShell article.
- To learn how to replicate your copy options from the app in your script click here.
Index
Examples
Import All Documents
$googleDrive= Connect-GoogleDrive -Email user@gmail.com $dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite" $dstList = Get-List -Name "mydstlib" -Site $dstSite Import-GoogleDriveDocument -GoogleDrive $googleDrive -SourceFolder "MyFolder/DocumentsToImport" -DestinationList $dstList -SourceView "MyDocuments"
Import documents in Admin mode
$googleDrive= Connect-GoogleDrive -Email admin@mycompany.com -Admin $dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite" $dstList = Get-List -Name "mydstlib" -Site $dstSite Import-GoogleDriveDocument -GoogleDrive $googleDrive -SourceFolder john.doe@mycompany.com -DestinationList $dstList -SourceView "MyDocuments"
Import Documents with a Property Template
$googleDrive= Connect-GoogleDrive -Email user@gmail.com $dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite" $dstList = Get-List -Name "mydstlib" -Site $dstSite Import-GoogleDriveDocument -GoogleDrive $googleDrive -SourceFolder "MyFolder/DocumentsToImport" -DestinationList $dstList -TemplateName "GoogleDriveImportTemplate" -SourceView "MyDocuments"
Specify Destination Folder
$googleDrive= Connect-GoogleDrive -Email user@gmail.com $dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite" $dstList = Get-List -Name "mydstlib" -Site $dstSite Import-GoogleDriveDocument -GoogleDrive $googleDrive -SourceFolder "MyFolder/DocumentsToImport" -DestinationList $dstList -DestinationFolder "MyFolder/MySubFolder" -SourceView "MyDocuments"
Specify File Paths to Copy
$googleDrive= Connect-GoogleDrive -Email user@gmail.com $dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite" $dstList = Get-List -Name "mydstlib" -Site $dstSite Import-GoogleDriveDocument -GoogleDrive $googleDrive -DestinationList $dstList -SourceFilePath "MyFolder/DocumentsToImport/Document1.docx","MyFolder/DocumentsToImport/Document2.docx" -SourceView "MyDocuments"
Specify File Paths to Copy (to Destination Folder)
$googleDrive= Connect-GoogleDrive -Email user@gmail.com $dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite" $dstList = Get-List -Name "mydstlib" -Site $dstSite Import-GoogleDriveDocument -GoogleDrive $googleDrive -DestinationList $dstList -SourceFilePath "MyFolder/DocumentsToImport/Document1.docx","MyFolder/DocumentsToImport/Document2.docx" -DestinationFolder "MyDestinationFolder" -SourceView "MyDocuments"
Specify File Paths to Copy in Admin mode
$googleDrive= Connect-GoogleDrive -Email admin@mycompany.com -Admin $dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite" $dstList = Get-List -Name "mydstlib" -Site $dstSite Import-GoogleDriveDocument -GoogleDrive $googleDrive -DestinationList $dstList -SourceFilePath "john@mycompany.com","jane@mycompany.com/docs" -SourceView "MyDocuments"
Import files from Excel file
$googleDrive= Connect-GoogleDrive -Email user@gmail.com $dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite" $dstList = Get-List -Name "mydstlib" -Site $dstSite Import-GoogleDriveDocument -GoogleDrive $googleDrive -DestinationList $dstList -ExcelFilePath "path_to_file.xlsx"
Note: Use this example to copy your documents based on an Excel spreadsheet.
Import All Documents PreCheck
$googleDrive= Connect-GoogleDrive -Email user@gmail.com $dstSite = Connect-Site -Url "http://myfarm1/sites/mydestinationsite" $dstList = Get-List -Name "mydstlib" -Site $dstSite Import-GoogleDriveDocument -GoogleDrive $googleDrive -SourceFolder "MyFolder/DocumentsToImport" -DestinationList $dstList -SourceView "MyDocuments" -WhatIf
Syntax
Import-GoogleDriveDocument
-GoogleDrive <GoogleDriveInfo>
-DestinationList <List>
-SourceView <GoogleDriveView {MyDocuments | SharedWithMe | AllDocuments | SharedFromExternal}>
-SourceFolder <Uri>
[-TemplateName <String>]
[-DestinationFolder <Uri>]
[-NormalMode <SwitchParameter>]
[-WaitForImportCompletion <SwitchParameter>]
[-WhatIf <SwitchParameter>]
[-CopySettings <CopySettings>]
[-MappingSettings <MappingSettings>]
[-TaskName <String>]
Import-GoogleDriveDocument
-GoogleDrive <GoogleDriveInfo>
-DestinationList <List>
-SourceView <GoogleDriveView {MyDocuments | SharedWithMe | AllDocuments | SharedFromExternal}>
-SourceFilePath <Uri[]>
[-TemplateName <String>]
[-SourceFolder <Uri>]
[-DestinationFolder <Uri>]
[-NormalMode <SwitchParameter>]
[-WaitForImportCompletion <SwitchParameter>]
[-WhatIf <SwitchParameter>]
[-CopySettings <CopySettings>]
[-MappingSettings <MappingSettings>]
[-TaskName <String>]
Import-GoogleDriveDocument
-GoogleDrive <GoogleDriveInfo>
-DestinationList <List>
-ExcelFilePath <String>
[-TemplateName <String>]
[-DestinationFolder <Uri>]
[-NormalMode <SwitchParameter>]
[-WaitForImportCompletion <SwitchParameter>]
[-WhatIf <SwitchParameter>]
[-CopySettings <CopySettings>]
[-MappingSettings <MappingSettings>]
[-TaskName <String>]
Import-GoogleDriveDocument
-GoogleDrive <GoogleDriveInfo>
-DestinationList <List>
-Template <PropertyTemplate>
-SourceView <GoogleDriveView {MyDocuments | SharedWithMe | AllDocuments | SharedFromExternal}>
-SourceFolder <Uri> [-DestinationFolder <Uri>]
[-NormalMode <SwitchParameter>]
[-WaitForImportCompletion <SwitchParameter>]
[-WhatIf <SwitchParameter>]
[-CopySettings <CopySettings>]
[-MappingSettings <MappingSettings>]
[-TaskName <String>]
Import-GoogleDriveDocument
-GoogleDrive <GoogleDriveInfo>
-DestinationList <List>
-Template <PropertyTemplate>
-SourceView <GoogleDriveView {MyDocuments | SharedWithMe | AllDocuments | SharedFromExternal}>
-SourceFilePath <Uri[]>
[-SourceFolder <Uri>]
[-DestinationFolder <Uri>]
[-NormalMode <SwitchParameter>]
[-WaitForImportCompletion <SwitchParameter>]
[-WhatIf <SwitchParameter>]
[-CopySettings <CopySettings>]
[-MappingSettings <MappingSettings>]
[-TaskName <String>]
Import-GoogleDriveDocument
-GoogleDrive <GoogleDriveInfo>
-DestinationList <List>
-Template <PropertyTemplate>
-ExcelFilePath <String>
[-DestinationFolder <Uri>]
[-NormalMode <SwitchParameter>]
[-WaitForImportCompletion <SwitchParameter>]
[-WhatIf <SwitchParameter>]
[-CopySettings <CopySettings>]
[-MappingSettings <MappingSettings>]
[-TaskName <String>]
Parameters
-CopySettings <CopySettings>
Specifies the copy settings.
Required? | False |
Default value | None |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-DestinationFolder <Uri>
Specifies the folder path at the destination.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-DestinationList <List>
Specifies the destination list.
Required? | True |
Default value | None |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-ExcelFilePath <String>
Specifies the path of the file used for metadata. Supported formats are Excel and CSV.
Required? | True |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | TemplateNameExcelFilePath, TemplateExcelFilePath |
Aliases | None |
-GoogleDrive <GoogleDriveInfo>
Specifies the source Google Drive.
Required? | True |
Default value | None |
Accept pipeline input? | True (ByValue, ByPropertyName) |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-MappingSettings <MappingSettings>
Specifies the mapping settings.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-NormalMode <SwitchParameter>
Specifies that the normal mode should be used.
Note: Insane mode is always used by default in PowerShell.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-SourceFilePath <Uri[]>
Specifies the source file path.
Required? | True |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | TemplateNameSourceFilePath, TemplateSourceFilePath |
Aliases | None |
-SourceFolder <Uri>
Specifies the folder path at the source.
Required? | True |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | Default, TemplateNameSourceFilePath, Template, TemplateSourceFilePath |
Aliases | None |
-SourceView <GoogleDriveView>
Specifies the source view, using the title.
Required? | True |
Default value | MyDocuments |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | Default, TemplateNameSourceFilePath, Template, TemplateSourceFilePath |
Aliases | None |
-TaskName <String>
Specifies a name for the task.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-Template <PropertyTemplate>
Specifies the property template. To use the built-in "Full Copy" template, do not specify this parameter.
Required? | True |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | Template, TemplateSourceFilePath, TemplateExcelFilePath |
Aliases | None |
-TemplateName <String>
Specifies the property template to use by its name. You can use Sharegate to configure property templates for the specified list. To use the built-in "Full Copy" template, do not specify this parameter.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | Default, TemplateNameSourceFilePath, TemplateNameExcelFilePath |
Aliases | None |
-WaitForImportCompletion <SwitchParameter>
Specifies that the command will wait for azure insane mode import to be completed.
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
-WhatIf <SwitchParameter>
Specifies that a pre-check will be executed instead of a migration
Required? | False |
Default value | None |
Accept pipeline input? | False |
Accept wildcard characters? | False |
Parameter set name | (All) |
Aliases | None |
Comments
0 comments
Please sign in to leave a comment.