Add DotnetTLS Pester test

This commit is contained in:
Vladimir Safonkin
2020-07-13 16:17:49 +03:00
parent 0c66b7b8ad
commit 0c57e97fb8
5 changed files with 10 additions and 31 deletions

View File

@@ -13,6 +13,7 @@ if(Test-Path $registryPath){
$registryPath = "HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319"
if(Test-Path $registryPath){
Set-ItemProperty -Path $registryPath -Name $name -Value $value -Type DWORD
}
}
Invoke-PesterTests -TestFile "Tools" -TestName "DotnetTLS"

View File

@@ -1,18 +0,0 @@
################################################################################
## File: Validate-DotnetTLS.ps1
## Desc: Validate DotNetFramework security protocol to TLS 1.2
################################################################################
$protocols = [Net.ServicePointManager]::SecurityProtocol
$protocolArr = $protocols -split ', '
if ($protocolArr.Contains('Tls12'))
{
Write-Host 'Tls 1.2 has been enabled.'
}
else
{
Write-Host 'Tls 1.2 has not been enabled.'
exit 1
}