This is a very simple task in every language I have ever used, but I cannot figure it out in PowerShell. An example of what I'm talking about in C:
abs(x + y)
The expression x + yis evaluated, and the result is passed absas a parameter ... how to do it in PowerShell? The only way I have guessed so far is to create a temporary variable to hold the result of the expression and pass this.
PowerShell seems to have very strange grammar and parsing rules that constantly catch me by surprise, just like this situation. Does anyone know the documentation or tutorial explaining the basic theory of language? I can’t believe that these are all special cases, there must be some kind of rhyme or reason that not a single textbook that I have yet to read explains. And yes, I read this question , and all these lessons are terrible. I was pretty much assigned to learning from existing code.
source
share