Created
December 3, 2018 19:57
-
-
Save pr3sidentspence/a17848af1b59b5e7042d432e8e05eef8 to your computer and use it in GitHub Desktop.
Script simply renames files as named by postcardscansimple.exe to an almalgamated version of it's BermanID.
This file contains 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( | |
[Parameter(Mandatory=$true)][string]$binder = $null | |
) | |
write-host renner started | |
Get-ChildItem -Filter *.bmp | | |
Foreach-Object { | |
# $origName = $_.FullName -replace 'f', '-front' | |
if ($_.BaseName -match '^[0-9]*[f|b]$') { | |
if ($_.BaseName -match 'f') { | |
$side = 'front' | |
} | |
else { | |
$side = 'back' | |
} | |
$origNum = [int]($_.BaseName -replace '[f|b]', '') | |
# Write-Host $origNum | |
$bottomID = (3 * $origNum).ToString("000") | |
$middleID = (3 * $origNum - 1).ToString("000") | |
$topID = (3 * $origNum - 2).ToString("000") | |
#$binder = $_.DirectoryName -replace '^.*\\(.*)$', '$1' | |
Write-Host Renaming $_.FullName to B$binder-$topID-$middleID-$bottomID-$side.bmp | |
& Rename-Item $_.FullName B$binder-$topID-$middleID-$bottomID-$side.bmp | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment