[英]How do I execute a powershell script by a shortcut key?
所以,你不能运行 PS 脚本,因为安全特性。 用户不能双击它。 您可以像这样创建 simple.bat:
powershell -command Set-ExecutionPolicy RemoteSigned
powershell -command Your Script
powershell -command Set-ExecutionPolicy Restricted
检查这个主题: 有没有办法通过双击 a.ps1 文件来使 PowerShell 脚本工作? 那里有更多的解决方案。
Go 到快捷方式设置中的General
选项卡,然后将Open with
从notepad
更改为
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.