Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
miladashrafi committed Dec 24, 2021
1 parent 092d14c commit e2b3aa1
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
13 changes: 13 additions & 0 deletions Powershell/Shecan OFF.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,16 @@ Write-Host 'Enter Network Adapter Index Number From Above List' -ForegroundColor
$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
}
}
While ($inputFound -eq $false)
19 changes: 16 additions & 3 deletions Powershell/Shecan ON.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,26 @@ $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
$I = Read-Host -Prompt 'Interface Index'
Set-DnsClientServerAddress -InterfaceIndex $I -ServerAddresses $Value
Write-Host "Network DNS SET Successfully."

$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
}
}
While ($inputFound -eq $false)


0 comments on commit e2b3aa1

Please sign in to comment.