Created
January 3, 2015 12:46
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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