Untitled

 avatar
unknown
plain_text
6 months ago
358 B
2
Indexable
$rnd = New-Object Random
$chunkSize = 1MB
$totalSize = 10GB
$filePath = "$pwd\randomData.bin"

$fs = [System.IO.File]::OpenWrite($filePath)
$chunks = [math]::Ceiling($totalSize / $chunkSize)

for ($i = 0; $i -lt $chunks; $i++) {
    $out = New-Object byte[] $chunkSize
    $rnd.NextBytes($out)
    $fs.Write($out, 0, $out.Length)
}

$fs.Close()
Editor is loading...
Leave a Comment