So far I have this:
netsh wlan show profiles | Select-String '^ All User Profile : (.*)' | ForEach-Object {
$array +=
$_.Matches[0].Groups[1].Value
}
$array[0]
$array[1]
$array[2]
$array[3]
$array[4]
$array[5]
$array[6]
$array[7]
$array[8]
pause
I want to be able to select the string after All User Profile :
and put it into an array, but it is only selecting a single letter. How do I select the strings instead? I want each array to be a different string, and there doesn't have to be 8 there can be more or less.
Split the selected string at ": ". (Note the space.) Then you get the profile name as the value of an array element.
Here's one way to think about how to extract the profile.
You are right to use the $matches variable.