Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Copy the contents of a Google Takeout for photos to create a local copy
Function CopyGooglePhotoTakeout
{
Param(
[Parameter(Mandatory=$true)]
[string]$sourcePath,
[Parameter(Mandatory=$true)]
[string]$destinationPath,
[Parameter(Mandatory=$true)]
[bool]$skipEdits
)
$count = 0
foreach ($path in (get-childitem $sourcePath -recurse))
{
$file = $sourcePath+"\*\"+$path
if($skipEdits -and $file.Contains("edited"))
{
echo "Skipping $file"
}
else
{
echo "Copying $file"
Copy-Item -Path $file -Destination $destinationPath
$count++
}
}
echo "Copied $count files."
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment