Skip to content

Instantly share code, notes, and snippets.

@mono0x
Last active Nov 27, 2021
Embed
What would you like to do?
$ErrorActionPreference = 'Stop'
foreach ($file in ($args | ForEach-Object { Get-Item $_ } | Sort-Object -Property FullName)) {
if ($file.Name -match '\A\d{8}-\d{6}-') {
# Already renamed (Skip)
}
elseif ($file.Name.ToUpper().StartsWith("GX")) {
# GoPro (Shift time zone)
exiftool.exe '-FileName<CreateDate' -d '%Y%m%d-%H%M%S-%%f.%%e' -api QuickTimeUTC -GlobalTimeShift -9 $file.FullName
}
else {
# Default
exiftool.exe '-FileName<CreateDate' -d '%Y%m%d-%H%M%S-%%f.%%e' -api QuickTimeUTC $file.FullName
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment