tag:help.appveyor.com,2012-11-13:/discussions/questions/3186-exclude-commands-from-pr-buildAppVeyor: Discussion 2018-10-19T08:18:12Ztag:help.appveyor.com,2012-11-13:Comment/419361382017-02-11T23:11:33Z2017-02-11T23:11:33ZExclude commands from PR build<div><p>You can use something like:</p>
<pre>
<code>- IF DEFINED dec_secret secure-file\tools\secure-file -decrypt src\myfile.txt.enc -secret %dec_secret%</code>
</pre></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/419361382017-02-11T23:46:19Z2018-05-21T15:02:30ZExclude commands from PR build<div><p>Is this possible with other parts of the config file as well? For example, I only have an artifact to attach if the environment variables are set in an earlier part of the build (env vars are needed to produce the artifact) so I imagine this will fail if the file does not exist?</p>
<p>artifacts:<br>
- path: com.package-%APPVEYOR_BUILD_NUMBER%.apk</p></div>kyle.spearrintag:help.appveyor.com,2012-11-13:Comment/419361382017-02-13T09:26:13Z2017-02-13T09:26:13ZExclude commands from PR build<div><p>Hi Kyle,</p>
<p>Build will not fail, it will just write warning like <code>No
artifacts found matching 'com.package-123.apk' path</code> assuming
<code>123</code> is build number.</p>
<p>Ilya.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/419361382017-02-14T03:44:23Z2018-05-21T15:02:30ZExclude commands from PR build<div><p>Great! Last question to wrap this one up:</p>
<p>What does the syntax look like for powershell command? Something like this?</p>
<p>after_build:<br>
- ps: IF($env:myvar) copy-item file1.txt .\file2-$($env:myvar).txt</p></div>kyle.spearrintag:help.appveyor.com,2012-11-13:Comment/419361382017-02-14T04:20:30Z2017-02-14T04:20:30ZExclude commands from PR build<div><p>Correct.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/419361382017-02-14T04:21:20Z2018-05-21T15:02:30ZExclude commands from PR build<div><p>Thanks all! This is now resolved.</p></div>kyle.spearrin