[powershell]想要點兩下就執行 powershell script

  • 64
  • 0
  • 2024-01-08

想要點兩下就執行 powershell script 該怎麼辦?

想要點兩下就執行 powershell script

好像沒這麼容易,網路上的解法是用一個 batch 來呼叫

Execute.bat 的內容

pushd %~dp0
powershell -NoProfile -ExecutionPolicy RemoteSigned ".\script.ps1"

 

參考

https://miajimyu.com/en/docs/powershell/powershell-tips/how-to-execute-powershell-by-double-click/

 

 

 

分享