New-DSGatewayRulesetAccessRule
Synopsis
Create a gateway ruleset access rule.
Syntax
__AllParameterSets
New-DSGatewayRulesetAccessRule [-Access] <GatewayAccessRule> [-Type] <NetworkAccessRuleType>
[-Value] <string> [<CommonParameters>]Description
Creates a gateway ruleset access rule. Depending on the specified type, a corresponding regular expression is applied to validate the input value. Use the resulting object with New-DSGatewayRuleset or Update-DSGatewayRuleset.
This cmdlet was previously named New-DSVirtualGatewayAccessRule. That name is still available as an alias.
Examples
Example 1
PS C:\> $rules = @(
New-DSGatewayRulesetAccessRule -Access Deny -Type IP -Value '1.2.3.4'
New-DSGatewayRulesetAccessRule -Access Deny -Type DNS 'a.com'
)
PS C:\> $gatewayId = Get-DSGateway -Name 'GatewayA' | Select-Object -ExpandProperty ID
PS C:\> New-DSGatewayRuleset -LinkedGatewayID $gatewayId -Name 'My gateway ruleset' -Description 'A little description' -Rule $rulesCreate a gateway ruleset that denies access from a specific IP address and the domain 'a.com'.
Example 2
Replace all existing access rules of the gateway ruleset for one that denies the IP address '1.2.3.4'.
Parameters
-Access
The effect of the rule.
-Type
The type of the rule.
-Value
The value of the rule based on the type.
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Outputs
Devolutions.PowerShell.PSOutputObject.PSGatewayAccessRule
Gateway ruleset access rule to use in (New, Update)-DSGatewayRuleset.
Notes
For more information, type "Get-Help New-DSGatewayRulesetAccessRule -detailed". For technical information, type "Get-Help New-DSGatewayRulesetAccessRule -full".
Last updated
Was this helpful?