Advertisement
Guest User

randomdata

a guest
Apr 27th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Function New-RandomFile {
  2.     Param(
  3.         $Path = '.',
  4.         $FileSize = 1kb,
  5.         $FileName = [guid]::NewGuid().Guid + '.txt'
  6.         )
  7.     (1..($FileSize/128)).foreach({-join ([guid]::NewGuid().Guid + [guid]::NewGuid().Guid + [guid]::NewGuid().Guid + [guid]::NewGuid().Guid -Replace "-").SubString(1, 126) }) | set-content "$Path\$FileName"
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement