PoshCode Archive  Artifact [8448e72403]

Artifact 8448e72403d45ace8f7cc800e8811795bcf74b4d5f608b8b477bfd549d4d5acd:

  • File Get-WifiProfiles.ps1 — part of check-in [f6d0e7360a] at 2018-06-10 13:42:24 on branch trunk — Uses netsh command to get all the computer’s wifi profiles (including clear text passwords) (user: CrazyDave size: 1240)

# encoding: ascii
# api: powershell
# title: Get-WifiProfiles
# description: Uses netsh command to get all the computer’s wifi profiles (including clear text passwords)
# version: 0.1
# type: function
# author: CrazyDave
# license: CC0
# function: Get-WifiProfiles
# x-poshcode-id: 4520
# x-archived: 2017-03-18T05:33:14
# x-published: 2014-10-15T17:01:00
#
#
function Get-WifiProfiles {
$tmpFolder = Join-Path $env:temp ([Guid]::NewGuid().ToString().Replace('-',''))
mkdir $tmpFolder | Out-Null

netsh wlan export profile key=clear folder=$tmpFolder | Out-Null

gci $tmpFolder\*.xml | % { 
    $data = [xml] (gc $_)
    New-Object PSObject -Property @{
        Name = $data.WLANProfile.name
        SSID = $data.WLANProfile.SSIDConfig.SSID.name
        ConnType = $data.WLANProfile.connectionType
        ConnMode = $data.WLANProfile.connectionMode
        AuthType = $data.WLANProfile.MSM.security.authEncryption.authentication
        Encryption = $data.WLANProfile.MSM.security.authEncryption.encryption
        KeyType = $data.WLANProfile.MSM.security.sharedKey.keyType
        Key = $data.WLANProfile.MSM.security.sharedKey.keyMaterial
    }
}


#Clean Up
ri -Force -Recurse -Path $tmpFolder
}