Consider:
$str = 'My {token} string'
$newStr = $str.Replace('{token}', 'value')
$newStr
My value string
function strReplace ($str, $rval) { $str.Replace('{token}', $rval) }
$newStr = strReplace($str, 'value')
$newStr
My string
value
Even though string.Replace returns a single string, an object[] shows up in the return pipeline. Why? Is there a way to get the obvious return value?