windows:start

Windows

One-liner (safe and explicit)

Get-ChildItem -Filter "D10 *" | Rename-Item -NewName { $_.Name -replace '^D10', 'D8' }

What this does:

  • Get-ChildItem -Filter “D10 *” grabs only files starting with D10
  • Rename-Item renames them
  • -replace '^D10', 'D8' swaps only the leading D10, not any later occurrences

Dry run (optional but wise)

If you want to preview first, add -WhatIf:

Get-ChildItem -Filter "D10 *" | Rename-Item -NewName { $_.Name -replace '^D10', 'D8' } -WhatIf
  • windows/start.txt
  • Last modified: 2026/01/20 12:39
  • by mh