Anyone know Powershell? Querying AWS with PS
Posted: Wed Jan 11, 2017 4:30 pm
I can find my way around this shit but, this has me stuffed.
Am trying to list out reserved instances in AWS using th eGet-EC2ReservedInstance cmdlet, but, no dice. at all.
The filter directive has as applicable value where state can be payment-pending | active | payment-failed | retired etc
Get-EC2ReservedInstance -Filter state=Active -ProfileName myProfile -Region ap-southeast-2
Get-EC2ReservedInstance : The filter 'State=Active' is invalid
At line:1 char:1
+ Get-EC2ReservedInstance -Filter State=Active -ProfileName myProfile -Region ap-s ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Amazon.PowerShe...dInstanceCmdlet:GetEC2ReservedInstanceCmdlet) [Get-EC2
ReservedInstance], InvalidOperationException
+ FullyQualifiedErrorId : Amazon.EC2.AmazonEC2Exception,Amazon.PowerShell.Cmdlets.EC2.GetEC2ReservedInstanceCmdlet
I know state is of 'string' type ; and no number of permutations / combinations has me able to return a successful result. I know state is valid as when i run the command without =Active, it returns nothing ....
Advice appreciated.
Am trying to list out reserved instances in AWS using th eGet-EC2ReservedInstance cmdlet, but, no dice. at all.
The filter directive has as applicable value where state can be payment-pending | active | payment-failed | retired etc
Get-EC2ReservedInstance -Filter state=Active -ProfileName myProfile -Region ap-southeast-2
Get-EC2ReservedInstance : The filter 'State=Active' is invalid
At line:1 char:1
+ Get-EC2ReservedInstance -Filter State=Active -ProfileName myProfile -Region ap-s ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Amazon.PowerShe...dInstanceCmdlet:GetEC2ReservedInstanceCmdlet) [Get-EC2
ReservedInstance], InvalidOperationException
+ FullyQualifiedErrorId : Amazon.EC2.AmazonEC2Exception,Amazon.PowerShell.Cmdlets.EC2.GetEC2ReservedInstanceCmdlet
I know state is of 'string' type ; and no number of permutations / combinations has me able to return a successful result. I know state is valid as when i run the command without =Active, it returns nothing ....
Advice appreciated.