public override void Execute() { base.Execute(); if (FqdnTag != null) { this.Protocol = PSAzureFirewallApplicationRuleProtocol.AllProtocols().ToArray(); FqdnTag = AzureFirewallFqdnTagHelper.MapUserInputToAllowedFqdnTags(FqdnTag, this.AzureFirewallFqdnTagClient).ToArray(); } var protocolsAsWeExpectThem = MapUserProtocolsToFirewallProtocols(Protocol?.ToList()); var applicationRule = new PSAzureFirewallApplicationRule { Name = this.Name, Description = this.Description, SourceAddresses = this.SourceAddress?.ToList(), SourceIpGroups = this.SourceIpGroup?.ToList(), Protocols = protocolsAsWeExpectThem, TargetFqdns = this.TargetFqdn?.ToList(), FqdnTags = this.FqdnTag?.ToList() }; WriteObject(applicationRule); }
public override void Execute() { base.Execute(); if (FqdnTag != null) { this.Protocol = new List <string> { "http", "https" }; FqdnTag = AzureFirewallFqdnTagHelper.MapUserInputToAllowedFqdnTags(FqdnTag); } var protocolsAsWeExpectThem = MapUserProtocolsToFirewallProtocols(Protocol); var applicationRule = new PSAzureFirewallApplicationRule { Name = this.Name, Description = this.Description, SourceAddresses = this.SourceAddress, Protocols = protocolsAsWeExpectThem, TargetFqdns = this.TargetFqdn, FqdnTags = this.FqdnTag }; WriteObject(applicationRule); }