Skip to content

Instantly share code, notes, and snippets.

@hoganlong
Created April 15, 2026 01:16
Show Gist options
  • Select an option

  • Save hoganlong/cec53304fcb9f4542f800265c5d40f51 to your computer and use it in GitHub Desktop.

Select an option

Save hoganlong/cec53304fcb9f4542f800265c5d40f51 to your computer and use it in GitHub Desktop.
PowerShell Rename files on aws bucket
$bucket = "s3://keithlong-art-photos/scans/"
aws s3 ls $bucket | ForEach-Object {
$file = ($_ -split '\s+')[-1]
if ($file -match '^KLA_Sketchbooks_(.+)$') {
$newfile = "KLA_$($Matches[1])"
Write-Host "$file -> $newfile"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment