on-internet
← Community

How to check if a function reference parameter is a specific variable in Powershell 7.7?

Stack Overflow ·

I'm running Windows 10. I'm writing a function that will be passed in three reference parameters and I want the function to either add or subtract a value that is in the first parameter to/from the the second parameter, and set the third parameter to this result. Whether to add or subtract is to be based on the actual variable passed into the function as the second parameter, for example: If $a is passed in, then add. If $b, then subtract. All three parameters will always be reference: the first is a custom class, and the other two are DateTime . I know that other languages can do this, but fr

Comments

Sign in or sign up to comment and upvote.

No comments yet.