Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get-S3Object -Key tag not returning exact match. #20

Open
DavidGWhitaker opened this issue Jun 4, 2019 · 1 comment

Comments

@DavidGWhitaker
Copy link

commented Jun 4, 2019

Expected Behavior
When I run the commands
$name = "file" ,
Get-S3Object -BucketName <bucketname> -Key "$name" -ProfileName PipelineCreds| Sort-Object -Property LastModified -Descending
When in S3 there exists two keys:

  • file/file.txt
  • file2/file.txt

I should be given file/file.txt

Current Behavior

When I run the commands
$name = "file" ,
Get-S3Object -BucketName <bucketname> -Key "$name" -ProfileName PipelineCreds| Sort-Object -Property LastModified -Descending
When in S3 there exists two keys:

  • file/file.txt
  • file2/file.txt

I am currently getting the incorrect value, file2/file.txt

Possible Solution

It seems like the -Key flag is using the functionality for the -KeyPrefix tag.

Steps to Reproduce (for bugs)
Please add a file/file.txt and a file2/file.txt (i dont think the file matters, but in my environment there is only one file in each folder.) in S3, and then run the command i used in the "Current Behavior" section

Context
I am trying to get files that match specific names. I do not want to just rename the "file2" folder in S3 because that would cause issues since the key matters for my program.

Your Environment
Include as many relevant details about the environment where the bug was discovered.

  • Affected module (AWSPowerShell or AWSPowerShell.NetCore): AWSPowerShell
  • Module version as reported by Get-AWSPowerShellVersion:
    AWS Tools for Windows PowerShell
    Version 3.3.485.0
    Copyright 2012-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.

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

  • Operating System and version as reported by $PSVersionTable.OS: N/a (using Windows Server 2016 Standard, 64-bit)
  • PowerShell verions as reported by $PSVersionTable.PSEdition: Desktop
@matteo-prosperi

This comment has been minimized.

Copy link
Contributor

commented Jun 5, 2019

Hello, we are investigating this. A fix may result in backward incompatible behavior for existing users though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.