Created
August 3, 2020 11:42
-
-
Save vestjoe/94393fe6ae8f660dce1fd54995fa3a02 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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