Skip to content

Instantly share code, notes, and snippets.

@eugrus
Created November 24, 2025 13:23
Show Gist options
  • Select an option

  • Save eugrus/5f55f08b0e6b48a36edb808cf91faffc to your computer and use it in GitHub Desktop.

Select an option

Save eugrus/5f55f08b0e6b48a36edb808cf91faffc to your computer and use it in GitHub Desktop.
Get-ChildItem -File | ForEach-Object { if ($_.Name -match '^(\d{2})\.(\d{2})\.(\d{4})\s+(.+)$') { $n = "$($matches[3])-$($matches[2])-$($matches[1]) $($matches[4])"; if (-not (Test-Path $n)) { Rename-Item -Path $_.FullName -NewName $n; Write-Host "$($_.Name) -> $n" -ForegroundColor Green } } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment