Reputation: 45
I'm rewriting a C# script in PowerShell, and I've hit another roadblock.
I'm pretty sure |
is the or
operator for C#.
Does this code mean get methods of this name with either an instance, public or nonpublic binding flag?
How off am I?
My end goal is to implement something similar into PowerShell. So, how can I do something similar in PowerShell?
type.GetMethod(Name, [System.Reflection.BindingFlags]::Instance | [System.Reflection.BindingFlags]::Public | [System.Reflection.BindingFlags]::NonPublic)
Upvotes: 1
Views: 200
Reputation: 200273
Yes, |
is the (bitwise) OR operator in C#. In PowerShell, however, |
is the "pipe" operator to connect the output of one cmdlet to the input of another. The binary OR operator in PowerShell is -bor
.
Also see about_Operators
.
Upvotes: 4