API Reference
Class
FirewallRuleSpec
Defines a firewall rule request in a typed form suitable for reuse by C# callers and cmdlets.
Inheritance
- Object
- FirewallRuleSpec
Constructors
public FirewallRuleSpec() #Methods
public Boolean TryValidate(out String error) #Returns:
BooleanValidates the specification and returns an error message when invalid.
Parameters
- error System.String@
Inherited Methods
public override Boolean Equals(Object obj) #Returns:
BooleanInherited from Object
Parameters
- 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").