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?