File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 This PowerShell script copies image files from <sourceDir> to <targetDir> sorted by year and month.
66. PARAMETER sourceDir
77 Specifies the path to the source folder
8- .PARAMTER targetDir
8+ . PARAMETER targetDir
99 Specifies the path to the target folder
1010. EXAMPLE
1111 PS> ./copy-photos-sorted.ps1 D:\iPhone\DCIM C:\MyPhotos
1212 ⏳ Copying IMG_20240903_134445.jpg to C:\MyPhotos\2024\09 SEP\...
13- ✅ Copied 1 photo to 📂C:\MyPhotos (0 skipped) in 41s .
13+ ✅ Copied 1 photo to 📂C:\MyPhotos in 13s (0 skipped).
1414. LINK
1515 https://github.com/fleschutz/PowerShell
1616. NOTES
8888 }
8989 [int ]$elapsed = $stopWatch.Elapsed.TotalSeconds
9090 [int ]$copied = $files.Count - $skipped
91- " ✅ Copied $copied photos to 📂$targetDir ( $skipped skipped) in $ ( $elapsed ) s."
91+ " ✅ Copied $copied photos to 📂$targetDir in $ ( $elapsed ) s ( $skipped skipped) ."
9292 exit 0 # success
9393} catch {
9494 " ⚠️ Error in line $ ( $_.InvocationInfo.ScriptLineNumber ) : $ ( $Error [0 ]) "
You can’t perform that action at this time.
0 commit comments