I have a .csproj file with this code:
<Target Name="PrecompileScript" BeforeTargets="BeforeBuild">
<Exec Command="powershell -file $(MSBuildProjectDirectory)\..\..\settings\copy-settings.ps1 $(MSBuildProjectDirectory)" />
</Target>
It should copy setting from one folder to another.
But after building project, I have an error with message
Severity Code Description Project File Line Suppression State
Error MSB3073 The command "powershell -file <path> exited with code 1.
If I'm trying to run this script from Windows cmd, it is successful.
How I should run the script from .csproj file?