'AWSCLI PowerShell - export security-groups detailed

I am trying to export EC2SecurityGroups via AWSCLI PowerShell.

Get-EC2SecurityGroup -Credential $Creds -Region us-east-1 > C:\us-east-1.txt

Exports ok, but format not showing everything in detail. When I run:

aws ec2 describe-security-groups --region us-east-1 > C:\us-east-1.txt

that shows detailed all rules.

Anyway to export same format using PowerShell?

Thanks!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source