Powershell

PowerShell: Generating QR Code for Wi-Fi Network in Windows 10

By February 21, 2020No Comments

You can use PowerShell to generate QR codes to share with your friends or colleagues. Let’s consider an example of using QRCodeGenerator PowerShell module to generate a  QR code image that can be used by your colleagues or guests to connect to your Wi-Fi network.

The QRCodeGenerator module may be used to generate PNG files with QR codes for the following object types:

  • vCard contact cards (business cards)
  • Geodata
  • Wi-Fi connection settings

You can download the QRCodeGenerator module manually (https://www.powershellgallery.com/packages/QRCodeGenerator/1.1) or using the following Package Management command:

Install-Module -Name QRCodeGenerator

After the module has been installed, open a new PowerShell window or import the module with this command:

Import-Module QRCodeGenerator

Change the PowerShell execution (running third-party scripts) policy :

Set-ExecutionPolicy Unrestricted -Scope Process

There are three PoSh cmdlets in this module: New-QRCodeGeolocationNew-QRCodeVCard and New-QRCodeWifiAccess.

To generate a QR code for a contact cards (vCard), use this script:

$strFirstName = "Corey"
$strLastName = "Zamara"
$strCompany = "Zamarax"
$strEmail = "[email protected]"
$strPath = "$home\desktop\vCard.png"
New-QRCodeVCard -FirstName $strFirstName -LastName $strLastName -Company $strCompany –Email $strEmail -OutPath $strPath

To generate a QR code to access a Wi-Fi network, specify the SSID of your network and the connection password. For example:

$strSSID = "WiFiGuestNet"
$strWiFipassword = "12345678"
$strPath = "$home\desktop\wifi.png"
New-QRCodeWifiAccess -SSID $strSSID -Password $strWiFipassword -Width 10 -OutPath $strPath

If you don’t remember the password of your Wi-Fi access point or mobile Hotspot in Windows 10, you can display the SSID and password for the specific profile of the saved wireless network using the following command:

netsh.exe wlan show profiles name='Profile Name' key=clear

Go to your desktop and make sure there are two PNG files containing QR codes.

The feature of QR code recognition to connect a Wi-Fi network is integrated in iOS 11 and is available in many Android smartphones. Just scan this code using the camera, and your smartphone will automatically recognize that the QR code contains the Wi-Fi connection info and will suggest you to save them to connect to this Wi-Fi network.

Leave a Reply