[CmdletBinding()]Param() [System.Console]::OutputEncoding = [System.Text.Encoding]::UTF8 If ((Get-WindowsFeature DirectAccess-VPN).InstallState -eq "Available"){ return 0 } else { #Installed $protocolSupport = $false $result = (netsh.exe ras show wanport) for ($i = 0; $i -lt $result.Count; $i++){ if($result[$i] -like "*PPTP*") { if ($result[$i+1] -Like "*Remote Access Connections*") { $protocolSupport = $true Write-Verbose "PPTP Supported" } } elseif ($result[$i] -like "*L2TP*") { if ($result[$i+1] -Like "*Remote Access Connections*") { $protocolSupport = $true Write-Verbose "L2TP Supported" } } } if ($protocolSupport) { return 1 } else { return 0 } }