Skip to content

Assert‑TlsProtocol

dscbot edited this page Feb 1, 2026 · 2 revisions

SYNOPSIS

Asserts that the specified TLS/SSL protocols are enabled or disabled.

SYNTAX

Assert-TlsProtocol [-Protocol] <SChannelSslProtocols[]> [-Client] [-Disabled]
 [<CommonParameters>]

DESCRIPTION

Calls Test-TlsProtocol for the specified protocol(s) and throws a terminating error if the assertion fails. By default, the command asserts that the protocol(s) are enabled for server-side connections. Use the -Client switch to assert the Client key instead of the default Server key. Use the -Disabled switch to assert that the protocol(s) are disabled instead of enabled.

EXAMPLES

EXAMPLE 1

Assert-TlsProtocol -Protocol Tls12

Asserts that TLS 1.2 is enabled for server-side connections. Throws a terminating error if TLS 1.2 is not enabled.

EXAMPLE 2

Assert-TlsProtocol -Protocol Tls12 -Client

Asserts that TLS 1.2 is enabled for client-side connections.

EXAMPLE 3

Assert-TlsProtocol -Protocol Tls12 -Disabled

Asserts that TLS 1.2 is disabled for server-side connections. Throws a terminating error if TLS 1.2 is still enabled.

EXAMPLE 4

Assert-TlsProtocol -Protocol Ssl3, Tls -Disabled

Asserts that both SSL 3.0 and TLS 1.0 are disabled for server-side connections.

PARAMETERS

-Client

When specified, assert the protocol in the Client registry key instead of the default Server key.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Disabled

When specified, asserts that the protocol(s) are disabled. By default the command asserts that the protocol(s) are enabled.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Protocol

One or more protocol names to assert. Accepts values from the [SChannelSslProtocols] enum such as Ssl2, Ssl3, Tls, Tls11, Tls12, Tls13, Dtls1, Dtls12.

Type: SChannelSslProtocols[]
Parameter Sets: (All)
Aliases:
Accepted values: Ssl2, Ssl3, Tls, Tls11, Tls12, Tls13, DTls1, DTls12

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

None.

OUTPUTS

None.

NOTES

RELATED LINKS

Clone this wiki locally