2828 $metaEditorPath = " $ ( $env: AGENT_WORKFOLDER ) \_mql5\metaeditor64.exe"
2929 if (-not (Test-Path $metaEditorPath - PathType Leaf))
3030 {
31- Write-Host " Metatrader compiler not found. Downloading from $compilerDownloadLink "
31+ Write-Output " Metatrader compiler not found. Downloading from $compilerDownloadLink "
3232 [System.IO.Directory ]::CreateDirectory([System.IO.Path ]::GetDirectoryName($metaEditorPath )) | Out-Null
3333
3434 # fix the TLS issues, see here: https://stackoverflow.com/questions/41618766/powershell-invoke-webrequest-fails-with-ssl-tls-secure-channel
4343
4444 foreach ($file in $compileFiles )
4545 {
46- Write-Host " Compiling MQL5 files: $file "
46+ Write-Output " Compiling MQL5 files: $file "
4747
4848 $proc = New-Object System.Diagnostics.Process
4949 $proc.StartInfo.UseShellExecute = $false
@@ -58,19 +58,20 @@ try {
5858 $logFile = [System.IO.Path ]::ChangeExtension($file , " .log" )
5959 if (Test-Path $logFile - PathType Leaf)
6060 {
61- Write-Host " Compilation log $ ( [System.IO.Path ]::GetFileName($logFile )) :"
62- Write-Host " ====================================================================="
63- Write-Host (Get-Content $logFile - Raw)
61+ Write-Output " Compilation log $ ( [System.IO.Path ]::GetFileName($logFile )) :"
62+ Write-Output " ====================================================================="
63+ Write-Output (Get-Content $logFile - Raw)
6464 }
6565 else
6666 {
67- Write-Host " No log created during compilation."
67+ Write-Output " No log created during compilation."
6868 }
6969
7070 # 1 - when successful, 0 when fails
7171 if ($exitCode -ne 1 )
7272 {
73- Write-Error " Compilation failed (exit code $exitCode )"
73+ Write-VstsTaskError - Message " Compilation failed (exit code $exitCode )"
74+ Write-VstsSetResult - Result ' Failed' - Message " Compilation failed"
7475 }
7576 }
7677
0 commit comments