passing varaibles to function

is the only way to pass variables to function is like this :

function test {
Write-Host $arg1;
i understand i can’t call
test “dddd”+“eeeee”
but only
test $str

isn’t there another way to concat parms on the line i call the function?

Your code has a type - it should be param not params

Its not the only way but I think its the best especially when you start to look at advanced functions

you could do

test (“dddd”+“eeeee”)


Yep, put parentheses around the expression to force PowerShell into Expression mode parsing, instead of Argument mode. See the about_Parsing help file for all the details on this.