Skip to content

Instantly share code, notes, and snippets.

@lennartvdd
Created August 18, 2016 08:52
Show Gist options
  • Save lennartvdd/478dfd099836aafe19731b96192adee3 to your computer and use it in GitHub Desktop.
Save lennartvdd/478dfd099836aafe19731b96192adee3 to your computer and use it in GitHub Desktop.
Randomize Filenames - Useful for randomly presenting images using the default slideshow applications available in Windows
#Modify variables as required
$srcFolder = "in"
$destFolder = "out"
Get-ChildItem -File $srcFolder | ForEach-Object {
$newFile = $destFolder + "\$(Get-Random)-$($_.Name).jpg"
Copy-Item $_.FullName $newFile
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment