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

Calculate time difference in hours

This is supposed to be a query for a virtual machine in Amazon EC2, it lists the instances by it's instanceID and LaunchTime (when it was turned up) - and I want to calculate another column that is it's LaunchTime - Current Date/Time to get a…
1
vote
1 answer

AWS Powershell Module Set-AWSCredentials

We use several Powershell scripts that rely on having access to our AWS account. We use Set-AWSCredentials to set the access and secret keys. This has worked fairly well, except lately the credentials have gone missing just over the course of a…
nwalke
  • 3,170
  • 6
  • 35
  • 60
1
vote
3 answers

Error passing property from object to Stop-EC2Instance cmdlet

I am writing a number of functions for starting and stopping EC2 instances by the name tag not the ID. First I wrote a reporting function that can be found below. Function Get-EC2InstanceReport{ If((Get-Module -Name AWSPowerShell).Name -ne…
Ally Reilly
  • 282
  • 3
  • 15
1
vote
1 answer

AWS Tools: Copy-S3Object script fails in 2.x with Error "Bucket does not exist"

I am attempting to figure out why a script that works in AWS tools 1.x (I think 1.1.16?) Is now not working after upgrade to the latest AWS tools (2.0.3) The Script Import-Module "C:\Program Files (x86)\AWS…
SeanKilleen
  • 8,809
  • 17
  • 80
  • 133
1
vote
3 answers

How to get the IP Addresses of instances in an AWS Auto Scaling Group with Powershell?

I am trying to connect a powershell script to an Auto Scaling Group via the .NET Amazon API. I have checked the documentation here, but I am struggling to get an object that contains the IP addresses of the instances belonging to the Auto Scaling…
Bluz
  • 5,980
  • 11
  • 32
  • 40
0
votes
0 answers

I have a json file and using that i need to logon to AWS , set my role, and then retrieve the password from the secret stored within AWS

I am able to retrieve the credentials to logon to AWS using the JSON file. I am able to Set the credentials as well. I am facing issues when i am trying to code for logon to AWS console using powershell I tried this piece of code to retrieve…
Gtu
  • 3
  • 5
0
votes
0 answers

Creating id based backup for windows registry files and restore it using powershell

A script is linked with GPO of windows server in which when user logout/sign out from any terminal server managed in aws, backup script run itself and create a backup of registry files and upload it somewhere in cloud storage and then on next log in…
0
votes
0 answers

How install and run latest Apache and PHP Server over EC2 user data PowerShell script for window instance

I am beginner to this PowerShell script. Please help me with this as I got stuck here. I'm using this user data given below in ec2 window instance launch config So, how can we proceed here can we get the same way as we are getting in code deployment…
Sujal
  • 101
  • 1
  • 11
0
votes
0 answers

optimize AWSPowerShell module loading time

using 'AWSPowerShell' version 4.1.281: PS C:\Users\UserMe> (Get-Command Set-DefaultAWSRegion).ImplementingType.Assembly GAC Version Location …
edwio
  • 198
  • 3
  • 20
0
votes
1 answer

Powershell Parameter set cannot be resolved, AWS SSM Automation Document Builder Bug?

I do not know what to attempt anymore, I have about 15 revisions to my Automation runbook. It is very simple and straightforward. I have tried multiple different approaches to get my input parameters and my document parameters to work. But every…
0
votes
1 answer

AWS SM Automation aws:executeScript PowerShell import module not loading in script but works on the EC2 instance locally

I am attempting to run a simple powershell script as an Automation document on my Windows Server 2019 instances. Note, I am using the Tools for Windows PowerShell (AWSPowerShell module) and they are installed by default on all Windows-based Amazon…
0
votes
0 answers

PowerShell error: Missing '=' operator after key in hash literal. The hash literal was incomplete

I am trying to execute powershell command through cloudformation template. it is throwing below error from the log. and the same time same command is working if i execute manually from the windows powershell. please help me! i am very new to the…
vikram521
  • 35
  • 7
0
votes
1 answer

AWS SSO Login PowerShell

Due to security policy, connecting to AWS programmatically with PowerShell using an Access/Secret Key is not allowed at our organization anymore, and needs to be replaced with AWS SSO. But I didn't find any clear documentation on how to actually…
edwio
  • 198
  • 3
  • 20
0
votes
1 answer

how to set AWS default profile for AWS Tools for Powershell

If I am using AWS CLI commands ("aws"), it works to have it pick up the profile I'm using if I set the environment variable AWS_PROFILE so that I don't have to specify credentials or region for each command. This does not work for the AWS Powershell…
Roman
  • 344
  • 1
  • 6
  • 19
0
votes
1 answer

Powershell script works on one AWS EC2 instance, but not another. Both use same IAM role

I have a simple Powershell script to upload a file to S3. I have 2 EC2 instances that use the same IAM profile. The instances and S3 bucket all live in the same AWS account. I RDP into one instance, open Powershell prompt as admin, and the script…