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
Param( | |
[string]$source, | |
[string]$dest, | |
[string]$format = "yyyy/yyyy_MM/yyyy_MM_dd" | |
) | |
$shell = New-Object -ComObject Shell.Application | |
function Get-File-Date { | |
[CmdletBinding()] |
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
# Get the files which should be moved, without folders | |
$files = Get-ChildItem 'C:\Users\Thomas\OneDrive\OneDrive Camera Roll' -Recurse | where {!$_.PsIsContainer} | |
# List Files which will be moved | |
$files | |
# Target Filder where files should be moved to. The script will automatically create a folder for the year and month. | |
$targetPath = 'C:\Users\Thomas\OneDrive\pictures\Albums' | |
foreach ($file in $files) |