Improve type inference for foreach statement variables by:
Inferring strongly typed arrays from explicit array and array literal expressions when elements are of the same inferred type
Fix detection of foreach variable declaration. The previous logic was to check if the variable expression's start offset was after the end offset of the foreach statement, which will never be true in the body
Improve inference of what type the "Condition" of a foreach statement will enumerate as
Fixes#7230.
Adding the concept of a PSSyntheticTypeName, derived from PSTypeName,
that extends it with a list of synthetic members.
This allows us to express the inferred type of
```
[pscustomobject] @{
A = 1
B = "2"
}
```
as a "PSObject#A:B" and with information about the types of A and B.
This is also used to annotate the output of
```
Select-Object -Property
Select-Object -ExcludeProperty
Select-Object -ExpandProperty
```
Finally, it adds information about the types of the
`Group` and `Value` properties of the output of `Group-Object`
Based on standard practices, we need to have a copyright and license notice at the top of each source file. Removed existing copyrights and updated/added copyright notices for .h, .cpp, .cs, .ps1, and .psm1 files.
Updated module manifests for consistency to have Author = "PowerShell" and Company = "Microsoft Corporation". Removed multiple line breaks.
Separate PR coming to update contribution document for new source files: #6140
Manually reviewed each change.
Fix#6073
This PR adds type inference support for the 'MemberName' parameterset for Foreach-Object.
Both of the following should work:
```
Get-Process | % {$_.MainModule} | % Com<Tab>
Get-Process | % MainModule | % Com<Tab>
```
Before this change, only the first line worked, this PR addresses the second line.
Fixes#2596