Here is a powershell script I am using, it is based on an exisitng scripts with some modification.
the original script snippet is shown below.
$src= 'D:\My Pictures'
$CharWhiteList = '[^: \w\/]'
$Shell = New-Object -ComObject shell.application
$i = 1
Get-ChildItem $src*.jpg -Recurse | ForEach{
$dir = $Shell.Namespace($_.DirectoryName)
$taken = ($dir.GetDetailsOf($dir.ParseName($_.Name),12) -replace $CharWhiteList)
#echo $taken
if (!($taken -eq "") -and !($take -eq " "))
{
$datetaken = [DateTime]::ParseExact($taken,"d/MM/yyyy h:mm tt",$null)
$path = $datetaken | Get-Date -f "yyyy-MM"
$path = "$($src)\$($path)"
If(!(test-path $path))
{
New-Item -ItemType Directory -Force -Path $path
}
$dest = "$($path)\$($_.Name)"
if (!(Test-Path $dest -PathType leaf))
{
Move-Item -Path $_.FullName -Destination $path
}
}
}