I have a .NET Core 1.1 console project created with Visual Studio 2017.
After building the project, I need to run a powershell script so I added the following to the MyProject.csproj
file:
<Target Name="PostcompileScript" AfterTargets="Build">
<Exec Command="execute-tasks.ps1" />
</Target>
Now I need to build the project in a Linux environment, I need to instruct MSBuild to run execute-tasks.sh
instead of execute-tasks.ps1
when it is running in Linux.
I believe this is achievable via the Condition
attribute, but is there an MSBuild variable that holds the operating system name?