12 October 2016

Generate file of speciefic size

param(
    [string]$FileName,
    [double]$FileSize
)
    $FilePath = ((Get-Location).Path) + '\' + $FileName
    $File = [System.IO.File]::Create($FilePath)
    $File.SetLength($FileSize)
    $File.Close()

    Get-Item $File.Name

No comments:

Post a Comment