I have the following script, and I can't understand what is going on:
function foo {
param(
[string]$p1,
[string]$p2
)
echo $p1 $p2
}
$a = "hello"
$b = "world"
foo $a $b
foo $a, $b
The output is
PS C:\code\misc> .\param_test.ps1
hello
world
hello world
What is the difference between the two ways the function is called?