-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e2b3aa1
commit 8eb27a0
Showing
12 changed files
with
65 additions
and
53 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,22 @@ | ||
Get-DnsClientServerAddress -AddressFamily IPv4 | ||
Write-Host "" | ||
Write-Host 'Enter Network Adapter Index Number From Above List' -ForegroundColor Yellow | ||
$I = Read-Host -Prompt 'Interface Index' | ||
Set-DnsClientServerAddress -InterfaceIndex $I -ResetServerAddresses | ||
Write-Host "Network DNS RESET Successfully." | ||
|
||
|
||
$inputFound = $false | ||
Do { | ||
$I = Read-Host -Prompt 'Interface Index' | ||
|
||
If ($I -ne "" -and $I -ne $null) { | ||
Set-DnsClientServerAddress -InterfaceIndex $I -ResetServerAddresses | ||
Write-Host "Network DNS RESET Successfully." | ||
$inputFound = $true | ||
try{ | ||
Get-DnsClientServerAddress -AddressFamily IPv4 | ||
Write-Host "" | ||
Write-Host 'Enter Network Adapter Index Number From Above List' -ForegroundColor Yellow | ||
$inputFound = $false | ||
Do { | ||
$I = Read-Host -Prompt 'Interface Index' | ||
If ($I -ne "" -and $I -ne $null) { | ||
Set-DnsClientServerAddress -InterfaceIndex $I -ResetServerAddresses | ||
Clear-Host | ||
Write-Host "Network DNS RESET Successfully." -ForegroundColor Green | ||
$inputFound = $true | ||
} | ||
} | ||
While ($inputFound -eq $false) | ||
} | ||
catch{ | ||
Clear-Host | ||
Write-Host "**** An error occurred:" -ForegroundColor Red | ||
Write-Host $_ -ForegroundColor Red | ||
Write-Host $_.ScriptStackTrace -ForegroundColor Red | ||
} | ||
While ($inputFound -eq $false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,37 @@ | ||
$WebResponse = Invoke-WebRequest "https://shecan.ir" | ||
$DnsElementList = $WebResponse.AllElements | Where {$_.Class -eq "shecan-dns-ips"} | ||
$DnsList = @() | ||
for ($Index = 1; $Index -le 2; $Index++) | ||
{ | ||
Write-Host $DnsElementList[$Index-1].innerText -ForegroundColor Red | ||
$DnsList += '"' + $DnsElementList[$Index-1].innerText + '"' | ||
} | ||
$Value = '(' + ($DnsList -join ',') + ')' | ||
|
||
Get-DnsClientServerAddress -AddressFamily IPv4 | ||
Write-Host "" | ||
Write-Host $Value -ForegroundColor Red | ||
Write-Host 'Enter Network Adapter Index Number From Above List' -ForegroundColor Yellow | ||
|
||
$inputFound = $false | ||
Do { | ||
$I = Read-Host -Prompt 'Interface Index' | ||
|
||
If ($I -ne "" -and $I -ne $null) { | ||
Invoke-Expression "Set-DnsClientServerAddress -InterfaceIndex $I -ServerAddresses $Value" | ||
Write-Host "Network DNS SET Successfully." | ||
$inputFound = $true | ||
try{ | ||
Get-DnsClientServerAddress -AddressFamily IPv4 | ||
Write-Host "" | ||
Write-Host 'Enter Network Adapter Index Number From Above List' -ForegroundColor Yellow | ||
$inputFound = $false | ||
Do { | ||
$I = Read-Host -Prompt 'Interface Index' | ||
If ($I -ne "" -and $I -ne $null) { | ||
Write-Host "Please wait ..." | ||
Clear-Host | ||
Write-Host "Getting DNS(s) from Shecan.ir ..." -ForegroundColor Gray | ||
$WebResponse = Invoke-WebRequest "https://shecan.ir" -ForegroundColor Gray | ||
$DnsElementList = $WebResponse.AllElements | Where {$_.Class -eq "shecan-dns-ips"} | ||
$DnsList = @() | ||
for ($Index = 1; $Index -le 2; $Index++) | ||
{ | ||
Write-Host "DNS"$Index":" $DnsElementList[$Index-1].innerText -ForegroundColor Red | ||
$DnsList += '"' + $DnsElementList[$Index-1].innerText + '"' | ||
} | ||
$Value = '(' + ($DnsList -join ',') + ')' | ||
Invoke-Expression "Set-DnsClientServerAddress -InterfaceIndex $I -ServerAddresses $Value" | ||
Clear-Host | ||
Write-Host "Network DNS SET Successfully." -ForegroundColor Green | ||
$inputFound = $true | ||
} | ||
} | ||
While ($inputFound -eq $false) | ||
} | ||
While ($inputFound -eq $false) | ||
catch{ | ||
Clear-Host | ||
Write-Host "**** An error occurred:" -ForegroundColor Red | ||
Write-Host $_ -ForegroundColor Red | ||
Write-Host $_.ScriptStackTrace -ForegroundColor Red | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@echo off | ||
cd /D %~dp0 | ||
cls | ||
Powershell.exe -f "Powershell\Shecan OFF.ps1" | ||
pause |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@echo off | ||
cd /D %~dp0 | ||
cls | ||
Powershell.exe -f "Powershell\Shecan ON.ps1" | ||
pause |
Binary file not shown.