Import-Module Sharegate
$csvFile = "C:\Scripts\Onedrive.csv"
$table = Import-Csv $csvFile -Delimiter ","
$srcsiteConnection = Connect-Site -Url https://xxxxx-admin.sharepoint.com/ -Browser
$dstsiteConnection = Connect-Site -Url https://xxxx-admin.sharepoint.com/ -Browser
Set-Variable srcSite, dstSite, srcList, dstList
foreach ($row in $table) {
Clear-Variable srcSite
Clear-Variable dstSite
Clear-Variable srcList
Clear-Variable dstList
$srcSite = Connect-Site -Url $row.SourceSite -UseCredentialsFrom $srcsiteConnection
$dstSite = Connect-Site -Url $row.DestinationSite -UseCredentialsFrom $dstsiteConnection
$srcList = Get-List -Site $srcSite -Name "Documents"
$dstList = Get-List -Site $dstSite -Name "Documents"
Copy-Content -SourceList $srcList -DestinationList $dstList
}