如何通过 AutoHotkey 打开 PowerShell?

Rya*_*yan 8 windows-7 powershell autohotkey

我在 Windows 7 上运行 AutoHotkey 1.0.48.05。

我想要 CTRL-ALT-P 打开 PowerShell。

这是我到目前为止:

^!p::
    Run %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe
Return
Run Code Online (Sandbox Code Playgroud)

这是我得到的错误:

无法加载文件 C:\Users[用户名]\Documents\WindowsPowerShell\profile.ps1,因为在此系统上禁用了脚本的执行。有关更多详细信息,请参阅“get-help about_signing”。

我已经通过以管理员身份打开 PowerShell ISE 并运行Set-ExecutionPolicy RemoteSigned. (参见http://technet.microsoft.com/en-us/library/ee176949.aspx

我怎样才能解决这个问题?

更新:在 Windows 10 中,我什至不需要 AutoHotKey。相反,我可以按WIN+ XA,然后是。

zda*_*dan 6

如果您使用的是 64 位版本的 windows,则需要为 64 位 powershell 和 32 位设置执行策略。

这意味着您需要在 32 位 powershell 会话和 64 位 powershell 会话中运行相同的命令。对于 32 位 powershell,只需在“开始”菜单中搜索“Windows Powershell (x86)”。