Home

Awesome

Build Status

WiFiProfileManagement

Module used for management of wireless profiles.

This module leverages the native WiFi functions. I wanted to learn more about interoperability and have a PowerShell (not using netsh.exe) way to view passwords of WiFi profiles so I decided to work on this in my free time. Any feedback on how this module can be improved is welcome.

How to use

Drop the root folder in your PSModulePath, remove the branch name (ex. -dev )from the folder, and PowerShell should find the module.

Functions

Get-WiFiProfile

Set-WiFiProfile

New-WiFiProfile

Remove-WiFiProfile

Get-WiFiAvailableNetwork

Connect-WiFiProfile

Search-WiFiNetwork

Set-WiFiInterface

Examples

Get the WiFi profile information on wireless profile TestWifi

PS C:\>Get-WiFiProfile -ProfileName TestWiFi

        ProfileName    : TestWiFi
        ConnectionMode : auto
        Authentication : WPA2PSK
        Encryption     : AES
        Password       :

Obtaining the password for wireless profile TestWifi

        PS C:\>Get-WiFiProfile -ProfileName TestWiFi -ClearKey

        ProfileName    : TestWiFi
        ConnectionMode : auto
        Authentication : WPA2PSK
        Encryption     : AES
        Password       : password1

Deleting a WiFi profile

PS C:\>Remove-WiFiProfile -ProfileName FreeWifi

Updating a wireless profile

        PS C:\>$password = Read-Host -AsSecureString
        **********

        PS C:\>Set-WiFiProfile -ProfileName MyNetwork -ConnectionMode auto -Authentication WPA2PSK -Encryption AES -Password $password

Updating a wireless profile using the XmlProfile parameter.

        PS C:\>$templateProfileXML = @"
        <?xml version="1.0"?>
        <WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
            <name>MyNetwork</name>
            <SSIDConfig>
                <SSID>
                    <name>MyNetwork</name>
                </SSID>
            </SSIDConfig>
            <connectionType>ESS</connectionType>
            <connectionMode>manual</connectionMode>
            <MSM>
                <security>
                    <authEncryption>
                        <authentication>WPA2PSK</authentication>
                        <encryption>AES</encryption>
                        <useOneX>false</useOneX>
                    </authEncryption>
                    <sharedKey>
                        <keyType>passPhrase</keyType>
                        <protected>false</protected>
                        <keyMaterial>password1</keyMaterial>
                    </sharedKey>
                </security>
            </MSM>
        </WLANProfile>
        "@

        PS C:\>Set-WiFiProfile -XmlProfile $templateProfileXML

Creating a wireless profile

        PS C:\>$password = Read-Host -AsSecureString
        **********

        PS C:\>New-WiFiProfile -ProfileName MyNetwork -ConnectionMode auto -Authentication WPA2PSK -Encryption AES -Password $password

Creating a wireless profile (Use 802.1X)

        PS C:\>New-WiFiProfile -ProfileName OneXNetwork -ConnectionMode auto -Authentication WPA2 -Encryption AES -EAPType PEAP -TrustedRootCA '041101cca5b336a9c6e50d173489f5929e1b4b00'

List available WiFi networks

        PS C:\>Get-WiFiAvailableNetwork

        SSID         SignalStength SecurityEnabled  dot11DefaultAuthAlgorithm dot11DefaultCipherAlgorithm
        ----         ------------- ---------------  ------------------------- ---------------------------
                                63            True   DOT11_AUTH_ALGO_RSNA_PSK      DOT11_CIPHER_ALGO_CCMP
        gogoinflight            63           False DOT11_AUTH_ALGO_80211_OPEN      DOT11_CIPHER_ALGO_NONE

Connect to a WiFi profile

        PS C:\> $password = Read-Host -AsSecureString
        ************

        PS C:\> New-WiFiProfile -ProfileName MyNetwork -ConnectionMode auto -Authentication WPA2PSK -Encryption AES -Password $password

        The operation was successful.
        PS C:\> Connect-WiFiProfile -ProfileName MyNetwork

Versions

Unreleased

1.1.0

1.0.0

0.5.0.0

0.4.0.1

0.4.0.0

0.3.0.0

0.2.1.0

0.1.1.0

0.1.0.0