Skip to content

Instantly share code, notes, and snippets.

@roberto-mardeni
Created August 30, 2021 18:55
Show Gist options
  • Save roberto-mardeni/1cd56a820b3eccc875077181d8fba58a to your computer and use it in GitHub Desktop.
Save roberto-mardeni/1cd56a820b3eccc875077181d8fba58a to your computer and use it in GitHub Desktop.
Create file of size with PowerShell
param($filename="test.dat",$size="1MB")
$f = New-Object System.IO.FileStream $filename, Create, ReadWrite
$f.SetLength($size)
$f.Close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment