set run as Admin
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
#requires -version 5
|
#requires -version 5 -RunAsAdministrator
|
||||||
|
|
||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
@@ -46,9 +46,7 @@ function Get-GwIp {
|
|||||||
function Set-Route {
|
function Set-Route {
|
||||||
$Gw = Get-GwIp
|
$Gw = Get-GwIp
|
||||||
Foreach ($ip in $script:IPs) {
|
Foreach ($ip in $script:IPs) {
|
||||||
Start-Process -FilePath powershell.exe -ArgumentList {
|
|
||||||
route ADD $ip MASK 255.255.255.255 $Gw.NextHop
|
route ADD $ip MASK 255.255.255.255 $Gw.NextHop
|
||||||
} -verb RunAs
|
|
||||||
Write-Host "Set Route $ip/32 through SSLVPN"
|
Write-Host "Set Route $ip/32 through SSLVPN"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user