I'm trying to get all ASCII numbers and letters from Powershell for use as a key later on.
My code so far looks like this:
[char[]] $keyArray = @()
for($i = 65;$i -le 122;$i++)
{
if($i -lt 91 -or $i -gt 96)
{
$keyArray += [char]$i
}
}
for($i = 0; $i -le 9; $i++)
{
$keyArray += ("$i")
}
Write-Host [string]$keyArray
However, when I write this out (last line), I get the following with spaces in between each character:
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9
How can I remove those spaces?