protected override void ProcessRecord()
        {
            base.ProcessRecord();
            
            if (!string.IsNullOrEmpty(this.Name))
            {
                PSNetworkInterface networkInterface;

                if (ParameterSetName.Equals("ScaleSetNic"))
                {
                    networkInterface = this.GetScaleSetNetworkInterface(this.ResourceGroupName, this.VirtualMachineScaleSetName, this.VirtualMachineIndex, this.Name);
                }
                else
                {
                    networkInterface = this.GetNetworkInterface(this.ResourceGroupName, this.Name);
                }
                
                WriteObject(networkInterface);
            }
            else if (!string.IsNullOrEmpty(this.ResourceGroupName))
            {
                var getNetworkInterfaceResponse = new MNM.NetworkInterfaceListResponse();

                if (ParameterSetName.Equals("ScaleSetNic"))
                {
                    getNetworkInterfaceResponse = this.NetworkInterfaceClient.ListVirtualMachineScaleSetNetworkInterfaces(this.ResourceGroupName, this.VirtualMachineScaleSetName);
                }
                else
                {
                    getNetworkInterfaceResponse = this.NetworkInterfaceClient.List(this.ResourceGroupName);
                }
                
                var psNetworkInterfaces = new List<PSNetworkInterface>();

                foreach (var nic in getNetworkInterfaceResponse.NetworkInterfaces)
                {
                    var psNic = this.ToPsNetworkInterface(nic);
                    psNic.ResourceGroupName = this.ResourceGroupName;
                    psNetworkInterfaces.Add(psNic);
                }

                WriteObject(psNetworkInterfaces, true);
            }

            else
            {
                var getNetworkInterfaceResponse = this.NetworkInterfaceClient.ListAll();

                var psNetworkInterfaces = new List<PSNetworkInterface>();

                foreach (var nic in getNetworkInterfaceResponse.NetworkInterfaces)
                {
                    var psNic = this.ToPsNetworkInterface(nic);
                    psNic.ResourceGroupName = NetworkBaseCmdlet.GetResourceGroup(psNic.Id);
                    psNetworkInterfaces.Add(psNic);
                }

                WriteObject(psNetworkInterfaces, true);
            }
        }
        protected override void ProcessRecord()
        {
            base.ProcessRecord();

            if (!string.IsNullOrEmpty(this.Name))
            {
                PSNetworkInterface networkInterface;

                if (ParameterSetName.Equals("ScaleSetNic"))
                {
                    networkInterface = this.GetScaleSetNetworkInterface(this.ResourceGroupName, this.VirtualMachineScaleSetName, this.VirtualMachineIndex, this.Name);
                }
                else
                {
                    networkInterface = this.GetNetworkInterface(this.ResourceGroupName, this.Name);
                }

                WriteObject(networkInterface);
            }
            else if (!string.IsNullOrEmpty(this.ResourceGroupName))
            {
                var getNetworkInterfaceResponse = new MNM.NetworkInterfaceListResponse();

                if (ParameterSetName.Equals("ScaleSetNic"))
                {
                    getNetworkInterfaceResponse = this.NetworkInterfaceClient.ListVirtualMachineScaleSetNetworkInterfaces(this.ResourceGroupName, this.VirtualMachineScaleSetName);
                }
                else
                {
                    getNetworkInterfaceResponse = this.NetworkInterfaceClient.List(this.ResourceGroupName);
                }

                var psNetworkInterfaces = new List <PSNetworkInterface>();

                foreach (var nic in getNetworkInterfaceResponse.NetworkInterfaces)
                {
                    var psNic = this.ToPsNetworkInterface(nic);
                    psNic.ResourceGroupName = this.ResourceGroupName;
                    psNetworkInterfaces.Add(psNic);
                }

                WriteObject(psNetworkInterfaces, true);
            }

            else
            {
                var getNetworkInterfaceResponse = this.NetworkInterfaceClient.ListAll();

                var psNetworkInterfaces = new List <PSNetworkInterface>();

                foreach (var nic in getNetworkInterfaceResponse.NetworkInterfaces)
                {
                    var psNic = this.ToPsNetworkInterface(nic);
                    psNic.ResourceGroupName = NetworkBaseCmdlet.GetResourceGroup(psNic.Id);
                    psNetworkInterfaces.Add(psNic);
                }

                WriteObject(psNetworkInterfaces, true);
            }
        }