Created
June 3, 2019 10:37
-
-
Save jeevan-vj/6287da97d8b62c618552a5f3ac07210b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try | |
{ | |
$fs = [System.IO.FileStream]::New('c:\tempfiles\largefile.txt', [System.IO.FileMode]::Create, [System.IO.FileAccess]::Write, [System.IO.FileShare]::None) | |
$fs.SetLength(2 * 1024 * 1024 * 1024 -1) | |
} | |
finally | |
{ | |
if ($null -ne $fs -and $fs -is [System.IDisposable]) | |
{ | |
$fs.Dispose() | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment