Generate QR Code with PowerShell in Windows 10

PowerShell is an advanced form of command prompt. It is extended with a huge set of ready-to-use cmdlets and comes with the ability to use .NET framework/C# in various scenarios. PowerShell allows creating QR codes to share information between your devices and with other users.

There are plenty of methods and apps you can use to generate a QR code. However, PowerShell is a built-in solution, since it is bundled with the OS. See All ways to open PowerShell in Windows 10.

There is a special module, QRCodeGenerator, which can be used to generate QR codes. It supports the following object types.

  • Contact cards (vCard)
  • WiFi network data
  • Geolocation

First of all, you need to add the mentioned module to your PowerShell setup. Do it as follows.

Install the QRCodeGenerator module

  1. Open a new PowerShell console as Administrator.
  2. Type or copy-paste the following command: Install-Module -Name QRCodeGenerator. Tip: See Fix Install-Module is missing in PowerShell.
  3. Confirm the NuGet provider update if prompted (type "y"). Confirm Nuget Provider Update
  4. Next, confirm the installation from the 'PSGallery' repo. Again, enter "y".Confirm Psgallery Repo

You are done. Now you can use the module in your scenarios. Here is how.

To generate a QR Code with PowerShell in Windows 10, do the following.

  1. Open a new PowerShell console.
  2. Change PowerShell Execution Policy to 'Unrestricted'. In short, run the command Set-ExecutionPolicy Unrestricted -Scope Process.
  3. Confirm the command.Change Execution Policy
  4. Load the module with the next command: Import-Module QRCodeGenerator.
  5. Now you can use it to generate a QR code and save it as a PNG image. For example, you can generate a QR code for your wireless network using the following syntax:
    New-QRCodeWifiAccess -SSID $wifi -Password $pwd -OutPath $path

    Generate QR Code With PowerShell In Windows 10

You are done. Other usage examples:

  • Generate a vCard QR code: New-QRCodeVCard -FirstName $first -LastName $last -Company $company -Email$email -OutPath $path
  • Generate a Geolocation QR code: New-QRCodeGeolocation -Address $address -OutPath

That's it. Related articles:

2 thoughts on “Generate QR Code with PowerShell in Windows 10

  1. Phil

    It works like a charm!

    Reply
  2. Aki Pitkäjärvi

    Have you thought about adding a standard URL as a QR-code to this program

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.