https://blogs.technet.microsoft.com/heyscriptingguy/2014/07/...
Going back to the naming conventions, the conventional way to write ForEach is in PascalCase. The variations slip into code as it's also an alias, and aliases tend to be in all lower case, and also because naming convention guidelines are just suggestions, not something that is strongly enforced (Foreach does seem to be commonly used, even if it's not necessarily in the standard styles).
Generally speaking, PowerShell coding style is similar to .NET coding style. You can read a discussion about it here:
https://github.com/PoshCode/PowerShellPracticeAndStyle/issue...
By the way, I respect your right to use whatever language you like best, I'm just clarifying that whilst PowerShell may not have it's "PEP-8" or gofmt, there are still conventions that PowerShell coders follow.
Is it ForEach, Foreach, foreach, or ForEach-Object? Official documentation[1][2][3][4][5] has all four variations. Same for True/False, While, Write-Output, etc. Everything is case-insensitive and the docs can't decide which to use. Again, it kind of makes sense for a shell language when your users are used to case-insensitivity, but I much prefer stricter consistency in programming languages.
[1] https://docs.microsoft.com/en-us/powershell/module/microsoft...
[2] https://docs.microsoft.com/en-us/powershell/module/psworkflo...
[3] https://docs.microsoft.com/en-us/previous-versions/windows/i...
[4] https://technet.microsoft.com/en-us/library/hh551144.aspx
[5] https://docs.microsoft.com/en-us/powershell/module/microsoft...