Function Add ($x, $y)
{
$Ans = $x + $y
Write-Host “The Answer is $Ans”
}
is entered and saved as Add.ps1. When add 4 5 is executed, this is the result:
PS C:\Users\ddahlenburg\PowerShell> add 4 5
If the same code is entered in the command window the output is produced. What's up?