Skip to content

Instantly share code, notes, and snippets.

View MartinCZ-byte's full-sized avatar

MartinCZ-byte

View GitHub Profile
## Test-Connection ## INTERNET ##
$TestNetDNS = Test-Connection -Count 1 www.google.com -ErrorAction SilentlyContinue
if ($TestNetDNS -ne $null)
{
Write-Host "Internet available" -ForegroundColor Green
Stop-Process -Name "openvpn-gui" -Force 2> $null
Stop-Process -Name "openvpn" -Force 2> $null
##1 second waiting for OpenVpn renew##
Start-Sleep -Seconds 1
C:\PROGRA~1\OpenVPN\bin\openvpn-gui.exe --connect test-user.ovpn