$myValue= (.\command.exe arguments | select -first 1)
I run the above code in my Azure Devops pipeline,
$myValue contains the value I'm expecting, but I get:
##[error]PowerShell exited with code '1'.
returned once my task completes... Does anyone have any idea why? I don't know if this is a syntax problem, or if my command.exe does something strange to affect the exit code.
.\command.exe argumentsdoesn't cause an error? move it to atry{ ... } catch { Write-Error $_ }block to see what happensexit 0anywhere in your snippet.try catchloop and my.exeruns fine