Skip to content

Instantly share code, notes, and snippets.

@vestjoe
Created August 3, 2020 11:42
Show Gist options
  • Save vestjoe/94393fe6ae8f660dce1fd54995fa3a02 to your computer and use it in GitHub Desktop.
Save vestjoe/94393fe6ae8f660dce1fd54995fa3a02 to your computer and use it in GitHub Desktop.
Function GET-RdmString() {
param (
[int]$Length
)
$set = "abcdefghijklmnopqrstuvwxyz0123456789".ToCharArray()
$result = ""
for ($x = 0; $x -lt $Length; $x++) {
$result += $set | Get-Random
}
return $result
}
$name = GET-RdmString -length 24
$ext = (".doc",".docx",".xls",".xlsx",".txt",".pdf",".ppt",".pptx")
$name += $ext | Get-Random
write-output $name
fsutil file createnew $name (Get-Random -minimum 1000 -maximum 10000000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment