3 function Write-PipelineTelemetryError
{
4 local telemetry_category
=''
8 while [[ $# -gt 0 ]]; do
9 opt
="$(echo "${1/#--/-}" | awk '{print tolower($0)}')"
19 function_args
+=("$1 $2")
29 if [[ $force != true
]] && [[ "$ci" != true
]]; then
34 message
="(NETCORE_ENGINEERING_TELEMETRY=$telemetry_category) $message"
35 function_args
+=("$message")
36 if [[ $force == true
]]; then
37 function_args
+=("-force")
40 Write-PipelineTaskError
$function_args
43 function Write-PipelineTaskError
{
44 if [[ $force != true
]] && [[ "$ci" != true
]]; then
49 local message_type
="error"
55 while [[ $# -gt 0 ]]; do
56 opt
="$(echo "${1/#--/-}" | awk '{print tolower($0)}')"
86 local message
="##vso[task.logissue"
88 message
="$message type=$message_type"
90 if [ -n "$sourcepath" ]; then
91 message
="$message;sourcepath=$sourcepath"
94 if [ -n "$linenumber" ]; then
95 message
="$message;linenumber=$linenumber"
98 if [ -n "$columnnumber" ]; then
99 message
="$message;columnnumber=$columnnumber"
102 if [ -n "$error_code" ]; then
103 message
="$message;code=$error_code"
106 message
="$message]$*"
110 function Write-PipelineSetVariable
{
111 if [[ "$ci" != true
]]; then
118 local as_output
=false
119 local is_multi_job_variable
=true
121 while [[ $# -gt 0 ]]; do
122 opt
="$(echo "${1/#--/-}" | awk '{print tolower($0)}')"
138 -is_multi_job_variable|
-i)
139 is_multi_job_variable
=$2
147 value
=${value/\\r/%0D}
148 value
=${value/\\n/%0A}
151 local message
="##vso[task.setvariable variable=$name;isSecret=$secret;isOutput=$is_multi_job_variable]$value"
153 if [[ "$as_output" == true
]]; then
160 function Write-PipelinePrependPath
{
161 local prepend_path
=''
163 while [[ $# -gt 0 ]]; do
164 opt
="$(echo "${1/#--/-}" | awk '{print tolower($0)}')"
174 export PATH
="$prepend_path:$PATH"
176 if [[ "$ci" == true
]]; then
177 echo "##vso[task.prependpath]$prepend_path"