Post build event execute PowerShell

后端 未结 5 1076
南旧
南旧 2020-11-27 12:04

Is it possible to set up a .NET project with a post build event to execute a powershell script? I am using this script to generate some files.

Also can I pass whethe

5条回答
  •  醉梦人生
    2020-11-27 12:49

    command Set-ExecutePolicy will temporarily set execution policy under current session. If you set this in powershell and run post build command in vs you will still get not allowed. So set first then run your ps1 script like bellow

    powershell -ExecutionPolicy Unrestricted $(ProjectDir)Deploy.ps1 -ProjectDir $(ProjectDir) -TargetPath $(TargetPath)
    

提交回复
热议问题