Normally, I can run it by either right-click it and choose “run with powershell” or in the Powershell window, run “.\myscript.ps1”. My only choice now is in the powershell window and run “Powershell.exe -File .\myscript.ps1”. I’m using powershell 5.1. Any idea?
It turned out I don’t have permission to the target directory. I have manually share the target directory with myself and then I can run the powershell script. It doesn’t make any sense to me.