VB
Size: a a a
VB
VB
VB
VB
VB
АЩ
АЩ
$VPNServer = "vpn.domain.ru"
$ConfigVPN = "$env:APPDATA\Microsoft\Network\Connections\Pbk\rasphone.pbk"
$output = (Get-Content ("$ConfigVPN") -Raw) -split '(?=\[[^\]]+\])' |
foreach {
if ($_ -match "$VPNServer"){
$tmp = $_
$tmp = $tmp -replace 'ExcludedProtocols=\d+','ExcludedProtocols=8'
$tmp = $tmp -replace 'DisableClassBasedDefaultRoute=\d+','DisableClassBasedDefaultRoute=1'
$tmp = $tmp -replace 'PreferredHwFlow=\d+','PreferredHwFlow=1'
$tmp = $tmp -replace 'PreferredProtocol=\d+','PreferredProtocol=1'
$tmp = $tmp -replace 'PreferredCompression=\d+','PreferredCompression=1'
$tmp = $tmp -replace 'PreferredSpeaker=\d+','PreferredSpeaker=1'
$tmp = $tmp -replace 'AutoTiggerCapable=\d+','AutoTiggerCapable=1'
$tmp } else {$_}
}
$output = $output -join ''
$output
ИЛ
АЩ
ИЛ
ИЛ
ИЛ
АЩ
PG
ИЛ
АЩ
АЩ
ИЛ
АЩ
АЩ