I'm writing a simple powershell script, and I don't understand its behavior. Here is the code.
Function print($first,$second){
Write-Host "$first"
}
$one="Dog"
$two="Cat"
print($one,$two)
And here is the output.
Dog Cat
I don't know why its printing both parameters instead of just the one that I asked for. I found a similar question posted that says the answer to the solution is to write
print $one $two
But I don't know why. The other question is at How do I pass multiple string parameters to a PowerShell script?
Can anyone illuminate on this subject?