First of all, it is PowerShell. There is no space and observe the capitalization of letters.
Second, RTFM. There is a lot of documentation on Technet. Make use of that. There is built-in help. Read Help about_* topics.
Coming to your question, the foreach loop iterates over all collection. In your example, $names is an array of strings. An array is a collection.
In your example, when the foreach loop iterates over the collection, it copies each item in the collection to another variable called $name.
foreach ($name in $names) {}
Inside the foreach loop, you can use the $name variable to retrieve the value stored in the item. So, the following code will print the values in the collection.
foreach ($name in $names) {
$name
}
$name is a string. So, $name.Length gives us the length of that string.
+ is an arithmetic operator. It can be used to concatenate strings. In this case, $name + $name.length will result in the value getting appended with the length.
Here is the modified example with output:
$names = "jones","mike","Ash"
foreach ($name in $names)
{
$name + $name.Length
}
jones5
mike4
Ash3
Finally, coming to your example and the output:
$names = "jones","mike","Ash"
foreach ($name in $names)
{
"$name = " + $name.Length
}
jones = 5
mike = 4
Ash = 3
I hope this provides some explanation for you on what the example is doing.