Closed pauby closed 4 years ago
Thanks for reporting this. We will fix this ASAP.
The document page was updated with the corrected example: https://docs.aws.amazon.com/powershell/latest/reference/items/Get-EC2Instance.html. Thanks for reporting this.
I just encountered this same error message trying to pass a -Filter to the Get-EC2Tag
cmdlet. What I think threw me off-track was that in the built-in EXAMPLE 5, the Filter Name field syntax is resource-type
, but then in the cmdlet output, it shows ResourceId
(not resource-id
). Why are the taxonomy of the Filter and the return objects properties not consistent?
@bcdady This issue was closed as the documentation was resolved. Probably best to open a new issue for it.
@bcdady Please open a separate issue if you want to discuss this. But we would not be able to change this behavior.
As you can see here the behavior is inherited from the service protocol. The reason for the difference is probably due ResourceId
being a "first class" property of the resource, not a tag.
We can consider improving the documentation and the samples though, I created an issue to track this: https://github.com/aws/aws-tools-for-powershell/issues/131.
The help examples for the
Values
key in the hashtable provided to the -Filter parameter and the actual required in the hashtable don't match.Expected Behavior
The
Get-Help Get-Ec2Instance -Examples
command has this as one example:Therefore, I should be able to use this:
Current Behavior
When I run the above I get an exception:
Possible Solution
The examples say that the key in the hashtable should be
Value
but the actual required key isValues
. Following PowerShell best practice, it should really beValue
that is used, which matches the help. However, that's unlikely to be practical for backwards compatibility. So updating the help is easier.Your Environment
Include as many relevant details about the environment where the bug was discovered.
Get-AWSPowerShellVersion
: 3.3.604.0$PSVersionTable.OS
: Microsoft Windows 10.0.18362$PSVersionTable.PSEdition
: Core