When i am using batch file for invoking msbuild.exe ,logging functionality works fine.
But when it is written in powershell ,it doesn't log anything.
Following is the powershell script i am using . Any idea how to solve this?
# Script to invoke build
. ./vsvars32.ps1
Remove-Item "ViewBuild1.log"
$MsbuildBinPath="C:\Windows\Microsoft.NET\Framework\v4.0.30319"
$errorLogFileName="ViewBuild1Errors.log"
$buildLogFileName="ViewBuild1.log"
$MSBuildLogger="/flp1:Append;LogFile=ViewBuild1.log;Verbosity=Normal; /flp2:LogFile=ViewBuild1Errors.log;Verbosity=Normal;errorsonly"
$MSBuildFile="Build.Targets"
Write-Host --------------------------------------------
Write-Host Prepare for the build
Write-Host --------------------------------------------
&"$MsbuildBinPath\Msbuild.exe" $MSBuildFile "/t:Prepare" "$MSBuildLogger"
if ($LastExitCode -ne 0) {
Write-Host "It failed, send a mail"
}
#$LastExitCode
&"$MsbuildBinPath\Msbuild.exe" $MSBuildFile "/t:BuildAll" "$MSBuildLogger"
Viewbuild1.log has no contents at all after executing though i have used append option in filelogger.