Created
September 29, 2015 05:59
-
-
Save ghotz/11d2f189efdb568f836e to your computer and use it in GitHub Desktop.
Checks that all pictures from a Windows Phone Lumia 1020 have been uploaded to OneDrive
This file contains hidden or 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
# | |
# This script checks that all pictures from a Windows Phone Lumia 1020 | |
# have been uploaded to OneDrive. | |
# | |
# It takes a local backup of the phone's Camera Roll directory copied directly | |
# from the phone and checks that all pictures are present in Onedrive's local | |
# copy of the Camera Roll directory. | |
# | |
# Note: the scripts assumes hires copies are automatically uploaded and | |
# removes pictures that are already present without the __highres suffix | |
# in the picture name. | |
# | |
$SourceDir = "D:\Backups\Phone\Pictures\Camera Roll"; | |
$DestinationDir = "C:\Users\Gianluca\OneDrive\Pictures\Inbox Personal"; | |
dir (Join-Path $SourceDir "*_panorama.jpg") | % { | |
# verify pictures have been achived | |
if (Get-ChildItem -Path $DestinationDir -Filter ($_.BaseName + ".jpg") -Recurse) { | |
Remove-Item $_ | |
} | |
else { | |
Write-Output "$($_.BaseName) not found" | |
} | |
} | |
dir (Join-Path $SourceDir "*_Pro.jpg") | % { | |
$DirName = $_.DirectoryName; | |
$TestFilename = $_.BaseName + "__highres.jpg"; | |
$TestFullName = Join-Path $DirName $TestFilename; | |
# verify that all lowres pictures have also hires copies | |
if (!(Test-Path $TestFullName)) { Write-Output "Highres picture $TestFullName not found"} | |
else { | |
# verify pictures have been achived | |
if (Get-ChildItem -Path $DestinationDir -Filter ($_.BaseName + ".jpg") -Recurse) { | |
Remove-Item $_ | |
Remove-Item $TestFullName | |
} | |
else { | |
Write-Output "$($_.BaseName) not found" | |
} | |
} | |
} | |
Enter file contents here |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment