AWS Tools for PowerShell on macOS

May 3, 2019 #aws #powershell #macos

Since you can never have too many command lines and shells, today I thought about Installing PowerShell Core on macOS.

$ brew cask install powershell
$ pwsh
PowerShell 6.2.0
Copyright (c) Microsoft Corporation. All rights reserved.
Type 'help' to get help.

PS> Get-Date

Friday, May 3, 2019 6:49:34 PM

After that, it was time for Setting up the AWS Tools for PowerShell Core on Linux or macOS X and making sure it worked.

PS> Install-Module -Name AWSPowerShell.NetCore -AllowClobber
PS> Import-Module AWSPowerShell.NetCore
PS> Get-AWSPowerShellVersion

AWS Tools for PowerShell Core
Version 3.3.498.0
Copyright 2012-2018, Inc. or its affiliates. All Rights Reserved.

Amazon Web Services SDK for .NET
Core Runtime Version
Copyright 2009-2015, Inc. or its affiliates. All Rights Reserved.

Release notes:

This software includes third party software subject to the following copyrights:
- Logging from log4net, Apache License

Then my favorite command: AWS Security Token Service Get Caller Identity

PS> $STS = Get-STSCallerIdentity -ProfileName aws-account-alias -Region us-west-2
PS> $STS.Account
PS> $STS.UserId
PS> $STS.Arn

Kevin Hakanson

Multi-Cloud Certified Architect | DevSecOps | AppSec | Web Platform | Speaker | Learner | Builder
Twitter | LinkedIn | GitHub | Stack Overflow | Credly

© 2024 Kevin Hakanson (built with Gatsby)