Creating a security group
Next, create a Security group using the VPC created in the previous section on creating a cluster. The AWS region is required to be specified in the following command, if not configured in persisted/shell defaults:
$groupid = New-EC2SecurityGroup -VpcId "vpc-6e021915" -Region "us-east-1" -GroupName "hello-worldPSSecurityGroup" -GroupDescription "EC2-VPC from PowerShell"
List the EC2 security group with the following Get-EC2SecurityGroup
command:
Get-EC2SecurityGroup -Region "us-east-1" -GroupId $groupid
The EC2 security group gets listed, as shown here:

If required, the EC2 security group may be removed with the following command:
Remove-EC2SecurityGroup -Region "us-east-1" $groupid