I’m trying to add a property using add-member. Here is my code:
$f = ""
$f = $f | select started, ended
$f | add-member scriptProperty IsFinished { $this.Started -gte $this.Ended }
However, the last line of code throws an exception, I believe because of “-gte” in my scriptblock expression. The exception says:
You must provide a value expression on the right-hand side of the ‘-‘ operator.
I think you need use
-ge(Greater or equal) to avoid the error.Use :