As I started thinking about ways to approach this, it occurred to me that I rarely seem to need to use nested loops. I assume there are other ways to solve this, but nesting seemed like fun. Maybe this outline will prove useful for someone looking to learn a little bit more about nesting.
I broke the problem down into two parts:
- Create an alphanumeric array that conforms to the requirements (removing the I,O,1, and 0)
- Create a series of nested loops, with each loop representing 1 of the places in the 5 digit code
Once finished, the output was written to a .CSV file, and it looked similar to the small sample below:
BH3NA
BH3NB
BH3NC
BH3ND
BH3NE
BH3NF
BH3NG
If you were to let this run to completion, I believe it would generate 24,000,000 + unique codes (this post is about PowerShell, not Finite mathematics).