Skip to content

Instantly share code, notes, and snippets.

@xoner
Created October 15, 2012 08:05
Show Gist options
  • Save xoner/3891317 to your computer and use it in GitHub Desktop.
Save xoner/3891317 to your computer and use it in GitHub Desktop.
Change the extension of a set of files in powershell (in this gist from .markdown to .md)
foreach ($itFile in ls *.markdown)
{
if ($itFile -match '(.*)\.(\w+)')
{
Write-Host 'Renaming ' $itFile
$destFile = $Matches[1] + '.md'
mv $itFile $destFile
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment