Create dummy files with Powershell

Standard

The problem

I had to test a certain script where a lot of files needed to be copied. One problem I didn’t have a large set of files. So how can I create dummy files with Powershell.

The solution

The solution is the script below where you enter the following parameters

  • amount: Amount of files to be created
  • size: The size of the files. Can be inserted as 100kb, 1mb, 1gb
  • folder: The folder to create the files in
  • $name: Name of the files. The name will be the value of this parameter with a number
  • $extension: The extension of the file. Insert the value without the “.”

Example

If you like this script please leave a comment.

Leave a Reply