API Reference
FirewallRuleSpec
Defines a firewall rule request in a typed form suitable for reuse by C# callers and cmdlets.
Inheritance
- Object
- FirewallRuleSpec
Usage
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Accepted by parameters
- Method FirewallRuleActions.Create
- Method FirewallRulePlanner.Plan
Constructors
public FirewallRuleSpec() #Methods
public Boolean TryValidate(out String error) #BooleanValidates the specification and returns an error message when invalid.
Parameters
- error System.String@
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object
Properties
public String Name { get; set; } #Gets or sets the display name of the firewall rule.
public FirewallDirection Direction { get; set; } #Gets or sets the traffic direction for the rule.
public FirewallProtocol Protocol { get; set; } #Gets or sets the protocol filter. Use Any for program rules.
public FirewallProfileKind Profiles { get; set; } #Gets or sets the firewall profile mask.
public Boolean Allow { get; set; } #Gets or sets a value indicating whether the rule should allow traffic.
public String Program { get; set; } #Gets or sets the program path for program-based rules.
public Nullable<Int32> LocalPort { get; set; } #Gets or sets the inbound local port (single port).
public String LocalPortRange { get; set; } #Gets or sets the inbound local port range/list (e.g., "5000-5010,6000").
public Nullable<Int32> RemotePort { get; set; } #Gets or sets the outbound remote port (single port).
public String RemotePortRange { get; set; } #Gets or sets the outbound remote port range/list (e.g., "5000-5010,6000").