public sealed record FirewallRuleSpecification : IEquatable<FirewallRuleSpecification> Creates a local firewall rule. Name is the native rule name; Description is explanatory display text.
Remarks
An inbound allow rule must name a program, service, local port or ICMP protocol. Profiles default to Domain and Private; include Public explicitly.
Constructors
FirewallRuleSpecification
public FirewallRuleSpecification(string Name, FirewallDirection Direction, FirewallAction Action) Creates a local firewall rule. Name is the native rule name; Description is explanatory display text.
Remarks
An inbound allow rule must name a program, service, local port or ICMP protocol. Profiles default to Domain and Private; include Public explicitly.
Properties
ApplicationPath
public string ApplicationPath { get; init; } Program path; empty applies to all programs.
Description
public string Description { get; init; } Description.
EdgeTraversal
public bool EdgeTraversal { get; init; } Permit edge traversal.
Enabled
public bool Enabled { get; init; } Enabled state.
Grouping
public string Grouping { get; init; } Rule grouping, independently of its name.
IcmpTypesAndCodes
public string IcmpTypesAndCodes { get; init; } ICMP type/code expression; requires FirewallProtocol.IcmpV4 or FirewallProtocol.IcmpV6.
InterfaceTypes
public string InterfaceTypes { get; init; } Native interface type expression, such as All, LAN, Wireless or RemoteAccess.
Interfaces
public ImmutableArray<string> Interfaces { get; init; } Native interface names; empty applies to all interfaces.
LocalAddresses
public string LocalAddresses { get; init; } Local address expression.
LocalPorts
public string LocalPorts { get; init; } Local port expression; requires FirewallProtocol.Tcp or FirewallProtocol.Udp.
Name
public string Name { get; init; } No documentation.
Profiles
public FirewallProfiles Profiles { get; init; } Applicable profiles; Public is not included by default.
Protocol
public FirewallProtocol Protocol { get; init; } IP protocol; FirewallProtocol.Any by default. Other IANA numbers (0-255) are cast to FirewallProtocol.
RemoteAddresses
public string RemoteAddresses { get; init; } Remote address expression.
RemotePorts
public string RemotePorts { get; init; } Remote port expression; requires FirewallProtocol.Tcp or FirewallProtocol.Udp.
ServiceName
public string ServiceName { get; init; } Service name; empty applies to all services.