tag:help.appveyor.com,2012-11-13:/discussions/questions/297-unable-to-select-a-single-file-based-on-wildcardAppVeyor: Discussion 2018-08-25T01:44:09Ztag:help.appveyor.com,2012-11-13:Comment/332042212014-05-30T18:47:03Z2014-05-30T18:47:03ZUnable to select a single file based on wildcard<div><p>Hi Brian,</p>
<p>You can use environment variables substitution in artifact path,
for example <code>Args.$(appveyor_build_version).nupkg</code>.</p>
<p>As a side note - to target file in specific directory try
specifying full path to it, e.g.
<code>bin\release\*.dll</code>.</p>
<p>And last but not list you can use <code>appveyor.exe</code>
command line to push artifacts: <a href=
"http://www.appveyor.com/docs/build-agent-api#push-artifact">http://www.appveyor.com/docs/build-agent-api#push-artifact</a></p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/332042212014-05-30T19:38:25Z2014-05-30T19:38:27ZUnable to select a single file based on wildcard<div><p>Thanks for the quick response!</p>
<p>I can't use the environment variable as the version in the file
won't always match up with the nuget package version.</p>
<p>The directory is at the root of my repo, so I can't specify a
folder. I tried <code>C:\projects\args\Args.*.nupgk</code>, but I
got an error saying I had illegal characters.</p>
<p>Does the <code>appveyor.exe</code> support wildcard
characters?</p></div>Brian Balltag:help.appveyor.com,2012-11-13:Comment/332042212014-05-30T19:48:16Z2014-05-30T19:48:16ZUnable to select a single file based on wildcard<div><p>The following line <code>I can't use the environment variable as
the version in the file won't always match up with the nuget
package version.</code> <em>should</em> read <code>I can't use the
environment variable because the version in the file name won't
always match the build number.</code></p></div>Brian Balltag:help.appveyor.com,2012-11-13:Comment/332042212014-05-30T19:59:17Z2014-05-30T20:00:15ZUnable to select a single file based on wildcard<div><p>It's <code>:</code> not allowed, only relative paths are
accepted.</p>
<p>So, <code>Args.1.1.1.nupkg</code> is in the root of build
folder. I will make sure AppVeyor wildcard allows to grab it with
<code>Args.*.nupkg</code> - can't exclude there is a bug.</p>
<p>For now you can use the following PowerShell snippet to push
NuGet packages to artifacts:</p>
<pre>
<code>Get-ChildItem .\Args.*.nupkg | % { Push-AppveyorArtifact $_ -FileName $_.FullName }</code>
</pre>
<p>if you use <code>appveyor.yml</code> put it, for instance, in
after_build` section:</p>
<pre>
<code>after_build
- ps: Get-ChildItem .\Args.*.nupkg | % { Push-AppveyorArtifact $_ -FileName $_.FullName }</code>
</pre>
<p>otherwise on project settings UI in appropriate place.</p></div>Feodor Fitsner