Manage stored Wifi Network on macOS, and soon Windows and Linux too.
To use this module, the "Powershell-Wifi" folder, contaning both the psm1 and the psd1 files, must be in one of your default Powershell Modules folder. You can check what they are using :
Write-Output $env:PSModulePathYou can also manually enable it using the folowing command :
Import-Module <Path_to_the_Powershell-Wifi.psm1_file>The resulting object will retreive the password only on a "as-needed" basis, and, if needed, will result in the prompting of a user password.
ie, on macOS, $myWifi = Get-Wifi, won't trigger a password prompt
(because at this point the password is not retrieved), but Get-Wifi will,
because the password must be retrieved prior to displaying it.
If you want to retreive the pasword at the time of the creation of the Wifi object, you can use the -retreivePassword flag.
The default ToString() returned string is compliant with the format used in QRCodes, including escaping column characters :
Get-Wifi -SSID <SSID> -Password <Password>or
$myWifi = Get-Wifi -SSID <SSID> -Password <Password>
$myWifi.toString()$myWifi = Get-Wifi$myWifi = Get-Wifi -retreivePassword$myWifi = Get-Wifi -SSID <SSID>$myWifi = Get-Wifi -SSID <SSID> -Password <Password>