在Powershell ISE中,不显示任何输出

在Powershell ISE中,不显示任何输出,powershell,powershell-ise,Powershell,Powershell Ise,输入并保存为Add.ps1。执行add 4 5时,结果如下: Function Add ($x, $y) { $Ans = $x + $y Write-Host “The Answer is $Ans” } 如果在命令窗口中输入相同的代码,则生成输出。 怎么了?试着按如下方式调用脚本- 假设脚本保存在C:\Users\ddahlenburg\PowerShell PS C:\Users\ddahlenburg\PowerShell>/Add.ps1 4 5在ISE中运行箭头按钮

输入并保存为Add.ps1。执行add 4 5时,结果如下:

Function Add ($x, $y)
{
    $Ans = $x + $y
    Write-Host “The Answer is $Ans”
}
如果在命令窗口中输入相同的代码,则生成输出。
怎么了?

试着按如下方式调用脚本- 假设脚本保存在C:\Users\ddahlenburg\PowerShell


PS C:\Users\ddahlenburg\PowerShell>/Add.ps1 4 5

在ISE中运行箭头按钮!调用函数之前的脚本???
PS C:\Users\ddahlenburg\PowerShell> add 4 5