Was really pretty simple and just worked ;). Note, .NetCore is really important, I accidently installed AWSPowerShell instead of AWSPowerShell.NetCore, which installs but throws exceptions. Duh.
- Powershell home
- Powershell installation incl brew for macos
- PowershellGallery and AWSPowerShell.NetCore
Set-AWSCredential -ProfileName 'SOME-PROFILE.ROLE'
Set-DefaultAWSRegion -Region 'us-east-1'
note: Turns out running the Set- commands above makes the aws commandlets disappear. Use explicit region/profile on individual commands
# brew install powershell core (based on .net core)
brew tap caskroom/cask && brew cask install powershell
# load powershell
pwsh
# install aws cmdlets && set some defaults
Install-Module AWSPowerShell.NetCore
# explicit, common, parameters (profile/region)
Get-DDBTable -TableName SOME-TABLENAME -ProfileName 'SOME-PROFILE.ROLE' -Region 'us-east-1'
# use splatting as an easy way to pass/change parameters common to cmdlets
$CommonParams = @{"ProfileName"="SOME-PROFILE.ROLE";"Region"="us-east-1"}
Get-DDBTable -TableName SOME-TABLENAME @CommonParams
# change profile and get nonprod table
$CommonParams.ProfileName='SOME-OTHER-PROFILE.ROLE'
Get-DDBTable -TableName SOME-TABLENAME @CommonParams
# bask in the glory of powershell core on linux/macos