Created
June 18, 2021 20:25
-
-
Save foxyseta/cd29ee35fc6177b8d7cc984b51b3b54e to your computer and use it in GitHub Desktop.
Revisions
-
foxyseta created this gist
Jun 18, 2021 .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,12 @@ # configure Wi-Fi using dynamic IP (admin required) if (-not (new-object System.Security.Principal.WindowsPrincipal([System.Security.Principal.WindowsIdentity]::GetCurrent())).IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator)) { $newProcess = new-object System.Diagnostics.ProcessStartInfo "PowerShell"; $newProcess.Arguments = $myInvocation.MyCommand.Definition; $newProcess.Verb = "runas"; [System.Diagnostics.Process]::Start($newProcess); exit } netsh interface ip set address "Wi-Fi" dhcp netsh WLAN add profile "E:\wifi.xml" pause