Last active
October 8, 2018 00:32
-
-
Save Tomamais/5d85acf071efc0804ecec1ea4358f137 to your computer and use it in GitHub Desktop.
Powershell script to restart wi-fi connection
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
#Requires -RunAsAdministrator | |
if((Get-NetAdapter -Name 'Wi-Fi').Status -ne 'Connected' -And (Get-NetAdapter -Name 'Wi-Fi').Status -ne 'Up') | |
{ | |
Write-Output "Restarting Wi-Fi..." | |
Disable-NetAdapter -Name 'Wi-Fi' -Confirm:$false -AsJob | Wait-Job | |
Enable-NetAdapter -Name 'Wi-Fi'-Confirm:$false | |
} | |
else | |
{ | |
Write-Output "Wi-Fi is Ok!" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment