尝试从命令行运行 powershell 时遇到问题。当弹出窗口显示在蓝色背景中时,我输入了 powershell.exe 说:“此应用程序无法在您的 PC 上运行,以查找适用于您的 PC 检查发布者的版本”。然后命令提示符给出消息:“访问被拒绝。”
任何建议将不胜感激。
最佳答案
我的问题是 C:/windows/system32/powershell.exe
无效,如下图所示:
我可以在 C:\Windows\System32\WindowsPowerShell\v1.0\
中找到正确的可执行文件.
因此,如果这是您的问题,请尝试以下操作:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe .\my-script.ps1
取而代之的是:
powershell.exe .\my-script.ps1
关于powershell - 命令提示符 : access denied when run PowerShell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32115313/