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
0
votes
0 answers

add-ec2volume powershell script - need to get volume ID on new-ec2volume creation

I have this powershell script I want to add a new drive to an existing instance Param ( [string][Parameter(Mandatory) = $True] $InstanceId [string][Parameter(Mandatory = $True)] $driveletter, [int][Parameter(Mandatory = $True)] $size, …
er24rf4f
  • 1
  • 3
0
votes
1 answer

Update AWS ECS Task Definition with Powershell

long story short, I need to update my ECS Task definition via powershell in order to increase the "EphemeralStorage_SizeInGiB" which is only available via the AWS cli. I am able to successfully grab the task via the Get-ECSTaskDefinitionDetail…
0
votes
0 answers

unable to get default aws region using powershell in azure pipelines

I use AWS Tools for Powershell to set and get the Default AWS region using modules. I used Set-DefaultAWSRegion -Region us-east-2 to set the defaultAWSRegion in azure-pipelines.yaml using task. However, when trying to read the value using…
Sourav Kundu
  • 408
  • 2
  • 14
0
votes
1 answer

AWS PowerShell EventBridge assembly model not found

Error: New-Object : Cannot find type [PutEventsRequestEntry]: verify that the assembly containing this type is loaded Code: $entry = New-Object -Type Amazon.EventBridge.Model.PutEventsRequestEntry $entry.Detail = $detailObject $entry.Source =…
0
votes
1 answer

Granting permission to ALL objects in a bucket via AWS Powershell Tools?

I can grant specific permissions to a specific file easily, like this: Set-S3ACL -BucketName "bucket" -Key "file.txt" However, now I'm trying to do it for all the files: Set-S3ACL -BucketName "bucket" -Key "*" This does not work and it…
TFaws
  • 193
  • 2
  • 4
  • 15
0
votes
0 answers

get-ec2instance platform is blank

When i do the following (get-ec2instance -instanceid instance-id | select-object -expandproperty Instances).platform its blank but in the aws console I do see it in there. any idea?
0
votes
1 answer

System.Collections.Generic.List`1[Amazon.EC2.Model.GroupIdentifier]

trying export security groups but getting this in csv System.Collections.Generic.List`1[Amazon.EC2.Model.GroupIdentifier] any idea why? I think its because it cant export and array. but how do I convert this line to string $ec2.SecurityGroups I…
wwe34142
  • 7
  • 5
0
votes
0 answers

Why Does Executing A PowerShell Script Via PHP Cause an Exception?

I am creating a process where an AWS instance can be started if currently stopped, then backed up on-premises via an rsync-based script, and then stopped when done. I also want the script to be executable via a web interface. Given that the backup…
Neil Wehneman
  • 154
  • 1
  • 12
0
votes
0 answers

How to execute a powershell script from AWS SSM document and store the output into a variable

I am writing an AWS SSM document and using PowerShell as a scripting language. My task is to execute a PowerShell script with parameters from the AWS SSM document and store the output of the executed PowerShell script in a variable. I have already…
Ashish Goyanka
  • 207
  • 3
  • 11
0
votes
1 answer

Grant Use-STSRole (sts:AssumeRole) permission to any CodeBuild project

I have several AWS CodeBuild projects that use Use-STSRole to Assume Role of a more privlidged role (readwrite) in order to then read a secret from Secrets Manager. I have configured the readwrite role's Trust Relationship as: { "Version":…
Philip Pittle
  • 11,821
  • 8
  • 59
  • 123
0
votes
1 answer

AWS powershell commandlet (Write-CWDashboard) outputs message 'Should match exactly one schema in oneOf'

I was trying to create AWS cloudwatch dashboard using AWS powershell commandlet Write-CWDashboard. Though the command was successful but it's generating an output message as 'Should match exactly one schema in oneOf'. Complete details are below, I…
0
votes
1 answer

AWS powershell: Get-EC2InstanceType

I want to extract the bare metal instances with cpu Information via AWS PowerShell: Get-EC2InstanceType -Filter @{'name'='bare-metal';'values'='true' } Following answers are delivered: AutoRecoverySupported : False BareMetal …
TimoC
  • 687
  • 2
  • 6
  • 15
0
votes
1 answer

AWS PowerShell get Custon Tag Value

I'm working on an AWS Powershell script to return the custom tag value for the instance on which the script is run. The tag is "itowner" and the value would be an email address. This is my code, the first line works and returns the instanceId but I…
TIM02144
  • 593
  • 1
  • 4
  • 17
0
votes
2 answers

AWS PowerShell error Insufficient privileges to perform this action

I am new to using AWS PowerShell and I am having issues with executing commands in PowerShell. Specifically, I am having issues running the below command. When I log into an AWS EC2 and execute the same command in CLI using the same account…
Chris Lombardi
  • 861
  • 2
  • 14
  • 31
0
votes
2 answers

How can I know the Name of the "IAM role" attached to EC2 using PowerShell from EC2 Instance itself?

I have an EC2 instance (EC2_Windows_2019_Server_Test) which is attached to an "IAM role". How can I know the Name of the "IAM role" attached to EC2 using PowerShell from EC2 Instance itself?