[英]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.