How often have you worked on a project were you needed to create random files in big quantity in order to simulate a data usage ?

On some projects you might just need one or two big files, simply to measure bandwidth, or validate a backup procedure for example. On the next project, you might  need to create random files  to test a migration script and need a huge number of small files.

How do I create random files with human understandable names using PowerShell?

Well, i was facing that situation the other day, and started to write a function in order to create random files  with “humanly understandable” names. (and sometimes even funny names if you are lucky ;))

Find here the code for the function “Create-randomFiles” which will help you, well, create random files using powershell, and answer the scenarios above.

By | 2016-06-28T10:28:23+00:00 August 8th, 2012|Files and folders, Functions, PowerShell|3 Comments

About the Author:

Stéphane is a dynamic and passionate Cloud and datacenter Microsoft MVP since. He is the founder of the Basel PowerShell user Group (BPUG), the co-founder of the French Speaking PowerShell UserGroup (FRPSUG), author, blogger, and received the community award "PowerShell Hero" from Stéphane has implemented microsoft infrastructure solutions in various countries of Europe and is currently working in Basel / Switzerland. Stéphane help his clients to reduce their global infrastructure costs by implementing Microsft infrastructure solutions by combining great products such as System Center, Windows Server, with heavy automation using Windows PowerShell. Stéphane loves languages, Belgium beer, French cheese and French Wine. If any of these topics are of your interest, don't hesitate to come and say hi.


  1. Mark Bond January 1, 2018 at 3:24 pm - Reply

    Hi Stephane,

    I need to test SFTP upload generating 300 PDF files with random sizes from 1mb to 100mb. I am a noob and could not make your code work. Can you help please?

  2. Behrooz Sirouszad November 27, 2017 at 11:25 am - Reply

    it doesnt work on powershell 5 windows server 2016

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: