k3tchup
(MichaΕ Skrzypkowski)
May 19, 2023, 1:34pm
1
I have problem with outputting network path as log messages and as comments.
\\serverHostname\data\output\master
Outputted to comment or log message look like this β \serverHostname\data\output\master
\\serverHostname\data\output\release\branch
Outputted to comment or log message look like this β \serverHostname\data\output elease\branch
So 2 backslashes are escaped to one, and \r is escaped to return carriage ?
When I escape \\
with \\\\
, the output is \\\\
When I escape \r
with \\r
, the output is \release
Sparky
(Dave Sparks)
May 21, 2023, 12:22pm
2
Hi Michal,
What action or code are you using to output the log messages and comments?
No escaping is required when using the Log Entry action:
Log output:
Comment output:
Sparky
(Dave Sparks)
May 21, 2023, 11:44pm
3
From your previous posts, Iβm guessing that you are outputting the log messages and comments from a Powershell script. In this case, you do have to escape all backslashes. e.g.
write-Host "@@continua[message value='\\\\serverHostname\\data\\output\\master' status='information']"
write-Host "@@continua[message value='\\\\serverHostname\\data\\output\\release\\branch' status='information']"
write-Host "@@continua[addBuildComment comment='\\\\serverHostname\\data\\output\\master']"
write-Host "@@continua[addBuildComment comment='\\\\serverHostname\\data\\output\\release\\branch']"
This outputs the following to the log:
And the following comments:
See Custom Log Messages .
1 Like