function Get-EC2SecurityGroupDetails {
param (
[parameter()]
[string] $GroupName)
(Get-EC2SecurityGroup | Where-Object GroupName -EQ $GroupName)
.IpPermissions |
ForEach-Object {
[PSCustomObject]@{
IpProtocol = $_.IpProtocol
FromPort = $_.FromPort
ToPort = $_.ToPort
Ipv4Ranges = $_.Ipv4Ranges.CidrIp
}
}
}
How can I modify this function to include Group Name and Description? currently it lists only the specified Security Group, I’d like to list all Security Groups within the current region with their details. Any help would be greatly appreciated.