默认分类

n2n edge客户端自动部署

自动下载openvpn并安装taptun

$sourceUrl = "http://www.moonnn.top:82/filerun/tap-windows/OpenVPN-2.6.12-I001-amd64.msi"
$destinationPath = "C:\Users\Public\OpenVPN.msi"
Start-BitsTransfer -Source $sourceUrl -Destination $destinationPath
C:\Users\Public\OpenVPN.msi /passive #无人参与模式 - 只显示进度栏        

下载edge.exe 及配置文件edge.conf 并配置任务计划开机自动运行

$sourceUrl = "http://www.moonnn.top:82/filerun/n2n/edge.exe"
$destinationPath = "C:\Users\Public\edge.exe"
Start-BitsTransfer -Source $sourceUrl -Destination $destinationPath

$sourceUrl = "http://www.moonnn.top:82/filerun/n2n/edge.conf"
$destinationPath = "C:\Users\Public\edge.conf"
Start-BitsTransfer -Source $sourceUrl -Destination $destinationPath

schtasks /create /sc onstart /delay 0002:00 /tn "StartEdgeOnBoot" /tr "C:\Users\Public\edge.exe C:\Users\Public\edge.conf" /ru "SYSTEM" /rl HIGHEST /it
schtasks /run /tn  "StartEdgeOnBoot"

回复

This is just a placeholder img.