Questions tagged [aws-powershell]

The AWS Tools for Windows PowerShell are a set of PowerShell cmdlets that are built on top of the functionality exposed by the AWS SDK for .NET.

The AWS Tools for Windows PowerShell are a set of PowerShell cmdlets that are built on top of the functionality exposed by the AWS SDK for .NET. The AWS Tools for Windows PowerShell enable you to script operations on your AWS resources from the PowerShell command line.

Questions involving the AWS Command Line Interface (CLI) should be tagged with instead.

Resources

Books

165 questions
5
votes
1 answer

Get the latest Windows 2012R2 base AMI id using aws cli?

Is there a way to get the latest Windows 2012R2 base AMI id using aws cli? Something like Get-EC2ImageByName -Names WINDOWS_2012R2_BASE in Powershell. I want to use it in Linux. I have tried fetching AMI id with aws ec2 describe-images --owners…
5
votes
1 answer

Why does Get-EC2PasswordData return "The parameter is incorrect."?

I'm using powershell to call Get-EC2PasswordData like so: $instances = (Get-EC2Instance -Filter @($envFilter, $stateFilter)).Instances $instances | Foreach-object { $instID = $_.InstanceId Write-Host Getting password to $instID... …
Ryan Shillington
  • 23,006
  • 14
  • 93
  • 108
5
votes
1 answer

AWS - Assume IAM using PowerShell on an instance

This is more a sanity check because I've solved the problem but I'm unconvinced I've done it the smart way. The Problem I have some instances that have been assigned an IAM roles that allow them to access an S3 bucket. I then need to run some…
4
votes
2 answers

How to uninstall AWSPowerShell/AWS.Tools module from Powershell?

First steps in Powershell. I can not remove / uninstall AWSPowerShell module from AWS installed modules. Get-Module -Name AWSPowerShell,AWSPowerShell.NetCore,AWS.Tools.Common -ListAvailable showing as follows: Directory:…
Maciej
  • 1,209
  • 4
  • 16
  • 26
4
votes
4 answers

Name resolution failure attempting to reach service in region eu-west-1

I installed AWS for Powershell Tools on 3 machines - two Windows servers and one desktop Windows PC. Using the same configuration, one server fails with the error GET-S3Bucket Name resolution failure attempting to reach service in region eu-west-1…
amartinez
  • 169
  • 2
  • 14
4
votes
1 answer

Publish Lambda Function in AWS

I am attempting to publish a new Lambda function if it doesn't already exist. The Update seems to be working great, and I can update it at will. However when I try to do the Publish command I keep getting the error Member must not be…
Jon Harding
  • 4,928
  • 13
  • 51
  • 96
4
votes
4 answers

PowerShell for AWS: List only "folders" from S3 bucket?

Is there any easy way to use PowerShell to only get a list of "folders" from an S3 bucket, without listing every single object and just scripting a compiled list of distinct paths? There are hundreds of thousands of individual objects in the bucket…
Nick Schroeder
  • 1,340
  • 1
  • 13
  • 17
4
votes
3 answers

Weird Powershell `Set-AWSCredentials` error with INI file

I'm working on an unattended PowerShell script and want to store AWS credentials the Right Way. According to the documentation, I should be able to store credentials in a .ini file like this .\myAWSCredentials.ini [default] aws_access_key_id =…
Nathan
  • 3,842
  • 1
  • 26
  • 31
4
votes
1 answer

How can I copy files larger than 5GB between S3 buckets using PowerShell

How can I copy files larger than 5GB between S3 buckets using PowerShell? There are several examples of using PowerShell to copy files between AWS S3 buckets but they used the Copy-S3Object command which is limited to files less than 5GB.
Barry MSIH
  • 3,525
  • 5
  • 32
  • 53
4
votes
1 answer

AWS Powershell - Get SNS TOPIC by name

I can't find a way to retreive the SNS topic by name other than doing the following on an already created topic: $topicarn = New-SNSTopic -Name "$deployedAppVersion-$environment-Events" The problem with the above is if I get the $deployedAppVersion…
4
votes
2 answers

How can I identify local files that have already been uploaded to S3, and haven't changed since then?

The below script copies all files from a folder structure then pastes them to an S3 bucket. However I want it to be able to skip files that have not been changed since the last upload, to avoid duplicating the upload. Does anyone know how I can get…
4
votes
1 answer

How can I read from the memory stream of the "Plaintext" property returned by New-KMSDataKey?

I am using an AWS Powershell cmdlet New-KMSDataKey that creates a System.IO.MemoryStream that contains an encryption key that I need to use to encrypt some files. This is the documentation for the…
4
votes
1 answer

Any AWS Powershell command fails with message "Invalid URI: The hostname could not be parsed."

I am using powershell to create a new EC2 KeyPair using the script below: Import-Module AWSPowerShell $Region = "EU West" $ProfileName = "AWS Default" Initialize-AWSDefaults -ProfileName $ProfileName $KeyName = "SecurityEssentials" $KeyPair =…
johnstaveley
  • 1,400
  • 1
  • 22
  • 46
4
votes
3 answers

How to launch an EC2 instance into a VPC with a public IP address in PowerShell?

I have been trying to use the following script, but haven't been successful: $Ami=Get-EC2ImageByName WINDOWS_2012_BASE New-EC2Instance -ImageId $Ami[0].ImageId -MinCount 1 -MaxCount 1 -KeyName uckey -InstanceType ` t1.micro -SubnetId…
Evren
  • 161
  • 1
  • 7
4
votes
2 answers

How can I get AWS Instance Tags in user-data?

I use aws ec2 userdata with windows powershell scripts. I need instance bootstrapping. My idea is: EC2 instance tag adds.It's key name "Version", it's value "1.0.0.158-branchname" I have tried to get version tag value in userdata. I checked aws…
1
2
3
10 11