无法从Powershell命令(控制台)加载.ps1 powershell脚本

aja*_*jax 0 powershell

我陷入了这个奇怪的问题,我试图从powershell命令提示符执行powershell脚本.但是我也没有得到任何错误,也没有加载脚本.

我有脚本C:\temp\myFunction.ps1(有一个方法getMyName())

我打开powershell命令并导航到此目录并执行

./myFunction.ps1
Run Code Online (Sandbox Code Playgroud)

然后没有错误并返回到提示中的下一行.但是当我尝试调用函数getMyName时 - 我得到错误getMyName无法识别.

我设置了Execution-Policy to Unrestricted,我作为管理员运行powershell