AWS Tools for Windows version and reference %xunit20% in powershell

brant's Avatar

brant

29 Mar, 2017 05:38 PM

Greetings,
In appveyor.yml, I'm using AWS Tools for Windows cmdlets to create and remove AWS instances. The currently installed version on the AppVeyor VMs is 3.1.63: it doesn't include the Remove-EC2Instance cmdlet. Instead one can use Stop-EC2Instance -Terminate, but that is being deprecated. The current version is 3.3.67. Can you please update the AWS Tools for Windows.

Also, %xunit20% is defined in cmd, but not in ps as far as I can tell; i.e., $env:xunit20 is not defined. I have both cmd and ps sections in the after_deploy and would prefer just to stick with one ps section. Can you please add $env:xunit20 for ps reference.

Thank you,
Brant

  1. Support Staff 1 Posted by Ilya Finkelshte... on 29 Mar, 2017 09:26 PM

    Ilya Finkelshteyn's Avatar

    Hello,

    Yes, we will update AWS tools, please watch this GitHub issue. Until its done, temporary workaround is to run this on install stage:

    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
    

    It takes about 40 seconds, so should not increase your build too much.

    What about $env:xunit20 -- it definitely exists, check this this 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.

    Ilya.

  2. 2 Posted by brant on 30 Mar, 2017 08:45 PM

    brant's Avatar

    Hi IIya,

    Thank you for your help. Yes, I tried again and $env:xunit20 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 install stage. But now the AWS cmdlets are not running; e.g., the following message is displayed for:
    Set-AWSCredentials -StoreAs AWSROOT -AccessKey $env:AWS_ACCESS_KEY -SecretKey $env:AWS_SECRET_KEY

    Error:

    Set-AWSCredentials : Could not load type 'Amazon.Runtime.CredentialManagement.CredentialProfileOptions' from assembly 'AWSSDK.Core, Version=3.3.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604'.
    
    If you have any ideas, please let me know.
    Thank you,
    Brant
  3. Support Staff 3 Posted by Ilya Finkelshte... on 31 Mar, 2017 12:54 AM

    Ilya Finkelshteyn's Avatar

    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 .ps1 file and call it from CMD like this: - powershell.exe .\setAws.ps1.

    Thanks!
    Ilya.

  4. 4 Posted by brant on 31 Mar, 2017 04:32 PM

    brant's Avatar

    Thank you for the workaround IIya. I look forward to the updated AWS Tools, as mentioned above.

  5. Support Staff 5 Posted by Ilya Finkelshte... on 31 Mar, 2017 06:01 PM

    Ilya Finkelshteyn's Avatar

    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.

  6. Support Staff 6 Posted by Ilya Finkelshte... on 25 Apr, 2017 11:43 PM

    Ilya Finkelshteyn's Avatar

    It should work without wrapping script into .ps1 now

  7. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:16 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac