Skip to content

Instantly share code, notes, and snippets.

@panlw
Last active April 6, 2020 14:35
Show Gist options
  • Save panlw/c58531ca7116b76cfc2e14321c92cd35 to your computer and use it in GitHub Desktop.
Save panlw/c58531ca7116b76cfc2e14321c92cd35 to your computer and use it in GitHub Desktop.
// Rename files with a sequence number leading
ls |% { $i=0 }{ $i++; Rename-Item -NewName ('{0:2d}_{1}.png' -f $i,$_.basename) }
// List file name with size in MBs
ls |% { '{0,16} = {1} MB' -f $_.name, [math]::round($_.length/1mb) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment