Idera nSoftware Compellent

PowerShell.com

PowerTip of the Day

Email my PowerTip:
Twitter my PowerTip:

Creating Large Dummy Files With .NET

You can always resort to the underlying .NET framework whenever the functionality you need isn't available through a cmdlet.

The following code is a very fast way to generate really large test files:

$path = "$env:temp\testfile.txt"
$file = [io.file]::Create($path)
$file.SetLength(1gb)
$file.Close()
Get-Item $path

Twitter This Tip! ReTweet this Tip!

Copyright 2010 PowerShell.com. All rights reserved.