Skip to content

Instantly share code, notes, and snippets.

@andymarch
Created January 3, 2015 12:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andymarch/de6725833a28f018c6a0 to your computer and use it in GitHub Desktop.
Save andymarch/de6725833a28f018c6a0 to your computer and use it in GitHub Desktop.
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