Is there a way to call a function when using an equation within Powershell.
I am trying to something like the following however the last line returns an error You must provide a value expression...
.
function quote($str) {
return """" + $str + """";
};
$a= "abc: " + quote('hi'); # <-- Doesn't Work
I realize I could assign the quote to an intermediate variable and then do the concatenation ($q=quote('hi'); $a="abc: " + q$
) however I am hoping there is a simpler syntax.