In the Below script, the regular expression is returning the value “Environment_Server Environment_OTF Environment_MPU” to the variable “$token_name” (the value doesnt contain double quotes and includes spaces). Now, how can I pull each word seprately from the above value and print it? I mean, the above value contains 3 words, i want to print the 3 words one by one. Please help.
$num = 0
$Count2 = 2
while($num -le $Count2)
{
$token_name = @([regex]::matches($line,$tokenrep)| sort| get-unique)
$array_list = $token_name[$num -1]
write-host “the values are” $array_list
$num = $num + 1
}