The current issue with the way I'm doing this however is that, if there are any files within the MyDrive that are shared but not owned by $account they are not moved and left on the drive.
Is there an easy way to adjust for this and move files not owned by
$account while also preserving the structure and file sharing permissions of the
Shared Folder? I'm looking to move multiple nested shares that exist within user's MyDrive folders into departmental
Shared Drives.
Reference Function:
function GAM-MyDriveToSharedDrive{
param(
[Parameter(Mandatory=$true)]
$account,
[Parameter(Mandatory=$true)]
$DriveID
)
gam user $account move drivefile root teamdriveparentid $driveid mergewithparent true
}