finished

#-----------------------------------------------------------
#  Initialize some variables
#-----------------------------------------------------------
$tags = $null
$counter5 = 0
$counter4 = 0
$counter3 = 0
$counter2 = 0
$counter1 = 0

#-----------------------------------------------------------
#  Generate an alpha numeric list with 0,1,I,O removed
#-----------------------------------------------------------
$strChars = 65..90 | % { [char]$_ }
$strChars = $strChars -ne "I"
$strChars = $strChars -ne "O"
$strNums = 2..9
$myAlphaNum = $strChars + $strNums

#-----------------------------------------------------------
#  Get the length of the array for looping
#-----------------------------------------------------------
$len = $myAlphaNum.Length

#-----------------------------------------------------------
#  Generate all possible combinations for $myAlphaNum
#  starting with AAAAA.  THIS WILL TAKE SOME TIME!
#-----------------------------------------------------------
For ($i5=1; $i5 -lt $len; $i5++)
    {
         $p5 = $myAlphaNum[$i5-1]
         For ($i4=1; $i4 -lt $len; $i4++)
            {
                $p4 = $myAlphaNum[$i4-1]
                For ($i3=1; $i3 -lt $len; $i3++)
                    {
                        $p3 = $myAlphaNum[$i3-1]
                        For ($i2=1; $i2 -lt $len; $i2++)
                            {
                                $p2 = $myAlphaNum[$i2-1]
                                For ($i1=1; $i1 -lt $len; $i1++)
                                    {
                                        $p1 = $myAlphaNum[$i1-1]
                                                    $thisTag = $p5+$p4+$p3+$p2+$p1+"`n"
                                                    $tags = $tags + $thisTag
                                    }
                            }
                    }
            }

    }

#-----------------------------------------------------------
#  Output $tags to a .CSV file when done
#-----------------------------------------------------------
$tags | Export-Csv -Path C:\scripts\tags.csv

No comments:

Post a Comment