is it possible to do something like below in powershell?
$condition = "-eq 10"
$a=11
if ($a &$condition) {"yes"} else {"no"}
basically to create part of the statement outside the statement and then use it dynamically?
I am aware I can create the whole statement in variable and then run it using Invoke-Expression or as &$cmd, but I have a very long and complex if/else statement and trying to build part of it on the fly.
Hope it makes sense :)