This forum is closed. Thank you for your contributions.
THIs is really not a kids playground. There are many sites for kids who want outlearn to program. Start here: https://mommypoppins.com/coding-kids-free-websites-teach-learn-programming
For your particular need start by looking ip what a random number is the use the coding training in the above link to learn how to write a loop. ONe of the sites has a full example of how to generate random characters.
Please read this first: https://social.technet.microsoft.com/Forums/scriptcenter/en-US/c47b1bc2-f7fd-4d2e-8ff2-e8a81ce090d4/this-forum-is-for-scripting-questions-rather-than-script-requests?forum=ITCG
Also find scripts here: http://gallery.technet.microsoft.com/
Learn PowerShell: https://mva.microsoft.com/en-us/training-courses/getting-started-with-microsoft-powershell-8276
\_(ツ)_/