$numOfArgs = $args.Length
if ($numOfArgs -gt 0)
{
	$tap=$args[0]
	$status = Get-WMIObject win32_service -filter "name='RemoteAccess'"
	if ($status.StartMode -eq "Disabled")
	{
		Set-Service RemoteAccess -StartupType Manual
	}
	if ($status.State -eq "Stopped")
	{
		Start-Service RemoteAccess
	}
	Get-NetIPInterface | Where-Object -FilterScript {$_.InterfaceAlias -Eq $tap} | Set-NetIPInterface -Forwarding Enabled
	if ($numOfArgs -gt 1)
	{
		. $PSScriptRoot\GetICS.ps1
		. $PSScriptRoot\SetICS.ps1
		$lan=$args[1]
		Get-NetIPInterface | Where-Object -FilterScript {$_.InterfaceAlias -Eq $lan} | Set-NetIPInterface -Forwarding Enabled
		Set-ICS $lan $tap 1
	}
}