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
1
vote
1 answer

Get all IP Addresses assigned to an EC2 Instance

The function below as well as others that I have in the script to collect a complete inventory of everything we have in AWS, runs without any problems. However, I am missing all of the IP addresses that are assigned to the instance after the first…
1
vote
1 answer

AWSCLI PowerShell - export security-groups detailed

I am trying to export EC2SecurityGroups via AWSCLI PowerShell. Get-EC2SecurityGroup -Credential $Creds -Region us-east-1 > C:\us-east-1.txt Exports ok, but format not showing everything in detail. When I run: aws ec2 describe-security-groups…
1
vote
1 answer

How do I get CSV output when querying for IAM Groups and Users?

First time poster here. I have created a small script that outputs group membership in AWS. I have got the script to the point that it outputs the desired results but I require help getting the data in a readable format into a csv file.…
1
vote
2 answers

AWS Powershell: How do I retrieve the NextToken

Where do I retrieve the NextToken from when using the AWS Powershell CmdLets? For example when I call Get-CDDeploymentList I need to supply the NextToken to retrieve the next set of deployment IDs. However the Get-CDDeploymentList command only…
Castrohenge
  • 8,525
  • 5
  • 39
  • 66
1
vote
1 answer

How can I filter 'Get-EC2ImageByName' to get the latest stable AMI-ID (not-rc)?

I've been successfully gathering the AMI ID via Get-EC2ImageByName, but I am trying to determine a method to pull latest "not-rc" AMI. I currently run: Get-EC2ImageByName -Names *amzn-ami-pv*x86_64*ebs* - | Select-Object -ExpandProperty "ImageId"…
Kareem
  • 534
  • 1
  • 6
  • 17
1
vote
1 answer

How can I filter AWS Instances by IAM role in powershell and get the private ip address of that instance?

I am looking to get a script working that can filter AWS instances according to the IAM role assigned to it and then get the private ip address of it. I had asked a similar question recently: filtering ec2 instances by associated IAM role with boto…
1
vote
1 answer

Why is my output from Get-EC2VPC exporting as an empty CSV?

I have this codes below all working OK - however when i try to export to xls it does not export anything - i am getting blind now... any one can help? $StoppedInstances = (Get-EC2Instance).instances | Where-Object {$_.State.Name -eq "stopped" -or…
1
vote
1 answer

Issues while running Register-ELBInstanceWithLoadBalancer on powershell

I am trying to add existing Windows Instances to and ELB using below command on powershell :- Register-ELBInstanceWithLoadBalancer -LoadBalancerName ire798ELB -Instances i-2eb0a88d -Region us-east-1a But it is giving me below error…
1
vote
1 answer

AWS CLI in powershell for registering the node

I am creating a windows node and registering it to an already created ELB . What is the PowerShell equivalent of this command : aws elb register-instances-with-load-balancer --load-balancer-name --instances
Ishu Gupta
  • 1,071
  • 1
  • 19
  • 43
1
vote
2 answers

Why does New-ELBLoadBalancer fail with a WebException?

I'm trying to create an ELB using powershell using the script below, but it's failing with "New-ELBLoadBalancer : A WebException with status NameResolutionFailure was thrown." I'm not sure where to start, any hints? $HTTPListener = New-Object…
webber
  • 1,834
  • 5
  • 24
  • 56
1
vote
1 answer

How do I execute a script from Windows Powershell?

I created a small aws.bat script and then in PowerShell I navigated to the script directory. But when I type aws then I get an error message and it does not execute the script. Is there a special thing I should be doing? Here's what I have…
user1943020
1
vote
1 answer

Adding tags to ec2-Snapshots via powershell

I am trying to add tags to snapshots within AWS EC2 environment using powershell so that i can tag them for use down the road and some graduated snapshot retention. I can manually create them through the console but for the life of me cannot find…
Jon
  • 227
  • 2
  • 6
  • 15
1
vote
1 answer

Can I use AWS Tools for Powershell to create a new EC2 instance and set the private IP?

Cmdlet: New-EC2Instance -ImageId ami-abcdefg123 -MinCount 1 -MaxCount 1 -KeyName Keypair ` -SecurityGroupId sg-abcdefg -InstanceType m1.small ` -SubnetId subnet-01bd1e76 How can I change this to add a private IP…
1
vote
3 answers

Download files from S3 bucket + folder

I am writing a Powershell script using the AWS SDK to download a specified amount of files from a particular directory, within a bucket, in S3. When I run the script, I get this error, for each iteration of the loop: Read-S3Object : Illegal…
TaylorN
  • 386
  • 3
  • 13
1
vote
2 answers

How can I redirect this output to $null?

I'm using the AWS Powershell tools. When I run the following, I get a message from the cmdlet. (Set-AWSCredentials -AccessKey $key -SecretKey $secret -StoreAs "default") > $null I get the following message: INFO: Credentials loaded from the…
Ci3
  • 4,632
  • 10
  • 34
  • 44