命令提示符:运行PowerShell

时间:2015-08-20 10:05:04

标签: powershell command-prompt

尝试从命令行运行PowerShell时出现问题。当弹出窗口显示在蓝色背景中时,我键入powershell.exe:"此应用程序无法在您的PC上运行,以查找您的PC检查发布者的版本"。然后命令提示符给出消息:"访问被拒绝。"

任何建议都将受到高度赞赏。

1 个答案:

答案 0 :(得分:1)

我的问题是C:/windows/system32/powershell.exe无效,如下图所示:

enter image description here

我可以在C:\Windows\System32\WindowsPowerShell\v1.0\中找到合适的可执行文件。

因此,如果这是您的问题,请尝试以下方法:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe .\my-script.ps1

而不是:

powershell.exe .\my-script.ps1
相关问题