How to execute a PowerShell script from Notepad++

前端 未结 5 990
说谎
说谎 2021-02-06 03:44

I am using Notepad++ to edit a PowerShell file and want to be able to execute that file from inside Notepad++.

How can I set that up?

5条回答
  •  有刺的猬
    2021-02-06 04:22

    Based on the answers before:

    powershell.exe -ExecutionPolicy Unrestricted -NoLogo -File "$(FULL_CURRENT_PATH)"
    

    You can also add the -NoExit parameter to keep PowerShell from closing automatically:

    powershell.exe -ExecutionPolicy Unrestricted -NoExit -NoLogo -File "$(FULL_CURRENT_PATH)"
    

    Note: File has to be saved.

提交回复
热议问题