I don't understand why my function is not giving similar output as the first example of powershell code
PS C:\Users\shane> $x = 3
PS C:\Users\shane> $y = 6
PS C:\Users\shane> $a = $x + $y
PS C:\Users\shane> Write-Host "The answer is $a"
The answer is 9
My function using similar logic
PS C:\Users\shane> Function Add ($x, $y){
>> $a = $x + $y
>> Write-Host “The Answer is $a”
>> }
>>
PS C:\Users\shane> add 3,6
The Answer is 3 6
I would expect the output to say "The Answer is 9" instead of "The Answer is 3 6"
What am I doing wrong?