-
-
Save 7171u/ca7b70eabeb682b73cfb76860f55d52d to your computer and use it in GitHub Desktop.
Revisions
-
danvy created this gist
Sep 5, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ # Check these threads before proceeding: # https://github.com/microsoft/WSL/discussions/5857 # https://github.com/microsoft/WSL/issues/5821 if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] 'Administrator')) { $CmdLine = "-File `"" + $MyInvocation.MyCommand.Path + "`" " + $MyInvocation.UnboundArguments Start-Process -FilePath PowerShell.exe -Verb Runas -ArgumentList $CmdLine Exit } # Restart the Host Network Service Restart-Service -Force -Name hns # Restart the Windows Subsystem for Linux Manager Restart-Service LxssManager # Restart the WSL Network adapter Restart-NetAdapter -Name "vEthernet (WSL)"