tag:help.appveyor.com,2012-11-13:/discussions/problems/32779-powershell-comments-changes-the-scriptAppVeyor: Discussion 2022-09-14T21:02:14Ztag:help.appveyor.com,2012-11-13:Comment/550089222022-07-15T15:08:50Z2022-07-15T15:08:50ZPowerShell comments changes the script<div><p>Yep, because <code>ps: >-</code> joins everything into a single line if there are no gaps between them. You should either put an empty line between last four lines:</p>
<pre>
<code> - ps: >-
$ErrorActionPreference = "Stop";
./versionize.ps1 | %{ Update-AppveyorBuild -Version $_ };
# Environment variables are truncated to the first line in appveyor (see https://github.com/appveyor/ci/issues/1688)
# so we join these together as html - and it finally works. We take the message from the tag and use as release message.
$env:REPO_TAG_DESCRIPTION = (git tag -l --format='%(contents)' $env:APPVEYOR_REPO_TAG_NAME | Where-Object {$_}) -join "<br />";
Write-Host $env:REPO_TAG_DESCRIPTION;</code>
</pre>
<p>or use <code>ps: |</code> instead:</p>
<pre>
<code> - ps: |
$ErrorActionPreference = "Stop";
./versionize.ps1 | %{ Update-AppveyorBuild -Version $_ };
# Environment variables are truncated to the first line in appveyor (see https://github.com/appveyor/ci/issues/1688)
# so we join these together as html - and it finally works. We take the message from the tag and use as release message.
$env:REPO_TAG_DESCRIPTION = (git tag -l --format='%(contents)' $env:APPVEYOR_REPO_TAG_NAME | Where-Object {$_}) -join "<br />";
Write-Host $env:REPO_TAG_DESCRIPTION;</code>
</pre>
<p>otherwise, with <code>ps: >-</code> the last block becomes:</p>
<pre>
<code># Environment variables are truncated to the first line in appveyor (see https://github.com/appveyor/ci/issues/1688) # so we join these together as html - and it finally works. We take the message from the tag and use as release message. $env:REPO_TAG_DESCRIPTION = (git tag -l --format='%(contents)' $env:APPVEYOR_REPO_TAG_NAME | Where-Object {$_}) -join "<br />"; Write-Host $env:REPO_TAG_DESCRIPTION;</code>
</pre>
<p>basically a single comment.</p>
<p>Let me know if you have any questions.</p></div>Feodor Fitsner