tag:help.appveyor.com,2012-11-13:/discussions/suggestions/1230-aws-tools-for-windows-version-and-reference-xunit20-in-powershellAppVeyor: Discussion 2018-08-25T02:16:54Ztag:help.appveyor.com,2012-11-13:Comment/422593882017-03-29T21:26:55Z2017-03-29T21:26:55ZAWS Tools for Windows version and reference %xunit20% in powershell<div><p>Hello,</p>
<p>Yes, we will update AWS tools, please watch <a href="https://github.com/appveyor/ci/issues/1455">this</a> GitHub issue. Until its done, temporary workaround is to run this on <code>install</code> stage:</p>
<pre>
<code>Write-Host "Installing AWS SDK..." -ForegroundColor Cyan
Write-Host "Downloading..."
$msiPath = "$($env:USERPROFILE)\AWSToolsAndSDKForNet.msi"
(New-Object Net.WebClient).DownloadFile('http://sdk-for-net.amazonwebservices.com/latest/AWSToolsAndSDKForNet.msi', $msiPath)
Write-Host "Installing..."
cmd /c start /wait msiexec /i $msiPath /quiet
del $msiPath
Write-Host "AWS SDK installed" -ForegroundColor Green</code>
</pre>
<p>It takes about 40 seconds, so should not increase your build too much.</p>
<p>What about <code>$env:xunit20</code> -- it definitely exists, check this <a href="https://ci.appveyor.com/project/IlyaFinkelshteyn/projecta/build/1.22.819">this</a> build. Maybe something wrong with powershell syntax when you are calling it, feel free to send us your command if you have issue to figure it out.</p>
<p>Ilya.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/422593882017-03-30T20:45:49Z2017-03-30T20:45:49ZAWS Tools for Windows version and reference %xunit20% in powershell<div><p>Hi IIya,</p>
<p>Thank you for your help. Yes, I tried again and <code>$env:xunit20</code> is defined. Not sure why I was not getting it before. Also, I did as you suggested and the AWS SDK seems to install fine on the <code>install</code> stage. But now the AWS cmdlets are not running; e.g., the following message is displayed for:<br>
<code>Set-AWSCredentials -StoreAs AWSROOT -AccessKey $env:AWS_ACCESS_KEY -SecretKey $env:AWS_SECRET_KEY</code></p>
<p>Error:<br></p>
<pre>
<code>Set-AWSCredentials : Could not load type 'Amazon.Runtime.CredentialManagement.CredentialProfileOptions' from assembly 'AWSSDK.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604'.</code>
</pre>
If you have any ideas, please let me know.<br>
Thank you,<br>
Brant</div>branttag:help.appveyor.com,2012-11-13:Comment/422593882017-03-31T00:54:26Z2017-03-31T00:54:26ZAWS Tools for Windows version and reference %xunit20% in powershell<div><p>It seems that problem is related to the fact that AppVeyor build agent itself refers this DLL, but bit older version. To workaround this, wrap your AWS PowerShell code into <code>.ps1</code> file and call it from CMD like this: <code>- powershell.exe .\setAws.ps1</code>.</p>
<p>Thanks!<br>
Ilya.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/422593882017-03-31T16:32:05Z2017-03-31T16:32:05ZAWS Tools for Windows version and reference %xunit20% in powershell<div><p>Thank you for the workaround IIya. I look forward to the updated AWS Tools, as mentioned above.</p></div>branttag:help.appveyor.com,2012-11-13:Comment/422593882017-03-31T18:01:26Z2017-03-31T18:01:26ZAWS Tools for Windows version and reference %xunit20% in powershell<div><p>It should not take long, just note that updated AWS tools might not fix this last issue. So you will not be needed to download them, but still need wrap them in to .ps1 file.</p></div>Ilya Finkelshteyntag:help.appveyor.com,2012-11-13:Comment/422593882017-04-25T23:43:39Z2017-04-25T23:43:39ZAWS Tools for Windows version and reference %xunit20% in powershell<div><p>It should work without wrapping script into <code>.ps1</code> now</p></div>Ilya Finkelshteyn