Skip to content

tonytech83/add-wifi-profile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Add Wi‑Fi Profile (Windows)

Minimal script to remove, add, and connect to a Wi‑Fi profile using netsh.

Prerequisites

  • Windows 10/11
  • PowerShell 7+ (or Windows PowerShell)
  • Run in an elevated console (Run as administrator)
  • A valid WLAN profile XML file (e.g., A1.xml)

Files

  • add-wifi-profile.ps1: Script to install/connect the profile
  • A1.xml: Example WLAN profile XML

Usage

  1. Open PowerShell as Administrator in this folder.
  2. Optionally edit these variables in add-wifi-profile.ps1:
    • $SSID_NAME – target SSID name
    • $PROFILE_XML – path to the profile XML
    • $IFACE – Wi‑Fi adapter name (usually Wi‑Fi)
  3. Run:
./add-wifi-profile.ps1

Notes

  • If you don’t have the XML yet, connect once manually and copy it from: C:\ProgramData\Microsoft\Wlansvc\Profiles\Interfaces\...
  • The script removes any existing profile with the same name, adds the XML, verifies, then connects and disconnects after ~20 seconds. To stay connected, comment out the small disconnect block (the Start-Sleep and netsh wlan disconnect lines) in the script.
  • For a non-hashed (plain-text) key in the XML, set <protected>false</protected>.

About

Minimal script to remove, add, and connect to a Wi‑Fi profile using netsh.

Topics

Resources

Stars

Watchers

Forks