I recently installed the AWS .NET SDK which came with the PowerShell For AWS CLI enhancements.
I went ahead and added an IAM user and generated a key pair, then installed it into the SDK Store:
Set-AWSCredentails -AccessKey AAAAAAAAAAAAAA -SecretKey AAAAAAAAAA/AAAA -StoreAs default
I then tested my credentials by making a request that I knew I didn't have access to:
Get-EC2Instance
... Then was surprised to find out print out three EC2 instances. Instances I don't own! I tried this as well:
Get-EC2Instance -Profile default
Which produced the desired result, insufficient access. To continue testing, I added EC2FullAccess to my user and repeated the last line. It correctly printed my personal use EC2 instance:
GroupNames : {}
Groups : {}
Instances : {aws_personal}
OwnerId : 835586800000
RequesterId :
ReservationId : r-0e625fd77d0000000
However whenever I attempt a statement without the -Profile default, I am accessing another account. Without going into too much detail, I disabled my access to that account in AWS Dashboard. Now commands produce this output:
Get-EC2Instance : AWS was not able to validate the provided access credentials At line:1 char:1 + Get-EC2Instance
I do not have a .AWS directory in my %UserProfile%. Searching my computer for .aws or credentials fails to find a credential file which would explain this.