PowerShell 在windows上執行,用Windows內建的PowerShell 或是用 VSCODE直接執行

  • 99
  • 0

PowerShell 在windows上執行,用Windows內建的PowerShell  或是用 VSCODE直接執行

用Windows內建的PowerShell

1-在開始的程式集先找出 Windows PowerShell ,按右鍵「以系統管理員身份執行」

2-修改Windows 在執行政策上會有一定的安全性設置,在PowerShell的介面中,執行「Set-ExecutionPolicy RemoteSigned」

3-選擇 Y=全部

4-用「./」或「powershell -command」,執行script檔案=PS1的位置

EX: powershell -command "D:\test.ps1"

就可以了

 

VSCODE直接執行:

把script檔案=PS1,用VSCODE開啟就可以執行了
 

 

自我LV~