powershell - 命令提示符 : access denied when run PowerShell

标签 powershell command-prompt

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

任何建议将不胜感激。

最佳答案

我的问题是 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

关于powershell - 命令提示符 : access denied when run PowerShell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32115313/

相关文章:

linux - 在提示符下将输入的命令加粗

command-line - 批量启动命令未打开程序

powershell - invoke-command 似乎不起作用 - 我是否使用 winrm.cmd 正确配置 TrustedHosts?

powershell - Powershell 发送电子邮件时编码不起作用

xml - 比较两个 XML 文件 - 输出唯一

azure - New-AzSqlDatabaseImport 无法将参数绑定(bind)到参数 'OperationStatusLink',因为它为 null

sql-server - 使用SqlDataAdapter填充DataSet更改日期格式

c - 如何替换命令提示符中已打印的文本?

windows - 在 Windows 中查找 USB 以太网链路本地 IP 地址

c++ - 链接列表程序在收到用户的值后崩溃