0

Here are the code in powershell script I run to provision a Windows 2012 server on an ec2 instance:

# Set up chocolately Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) # Install awscli locally choco install -y awscli aws s3 sync s3://my-bucket/installation_files "c:\opt\installation_files" 

But when it comes to the aws s3, it failed with this error message

aws_instance.convertor (remote-exec): aws : The term 'aws' is not recognized as the name of a cmdlet, function, 

If I remote connect to the box afterward, I can rerun the aws s3 command with no problem

How can I work around this issue? Is it possible to spawn a new shell from within my powershell script and run aws s3 command from there?

2 Answers 2

0

Honestly, I never had much luck with using aws cli from powershell. I used batch due to the constant issues I had. Note: if you're behind a proxy you will need to set that via command line.

0

I've had similar issues that Leif mentions with running the AWS cli in PowerShell and have fallen back to just using it primarily in Git Bash or just CMD. However, if you have Python installed, you could also give running the AWS Python shell a try: https://github.com/aws/aws-cli

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.