Microsoft.Azure.Commands.Network.GetAzureEffectiveNetworkSecurityGroupCommand.Execute C# (CSharp) Method

Execute() public method

public Execute ( ) : void
return void
        public override void Execute()
        {
            base.Execute();

            var getEffectiveNsgs = this.NetworkInterfaceClient.ListEffectiveNetworkSecurityGroups(this.ResourceGroupName, this.NetworkInterfaceName);

            var psEffectiveNsgs = Mapper.Map<List<PSEffectiveNetworkSecurityGroup>>(getEffectiveNsgs.Value);

            WriteObject(psEffectiveNsgs, true);

            if (psEffectiveNsgs.Count == 0)
            {
                WriteWarning(Microsoft.Azure.Commands.Network.Properties.Resources.EmptyEffectiveNetworkSecurityGroupOnNic);
            }
        }
    }
GetAzureEffectiveNetworkSecurityGroupCommand