Advertisement

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.

Advertisеment

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:

Support us

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!

Advertisеment

Author: Sergey Tkachenko

Sergey Tkachenko is a software developer who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram, Twitter, and YouTube.

3 thoughts on “Generate QR Code with PowerShell in Windows 10”

Leave a Reply

Your email address will not be published.

css.php
Using Telegram? Subscribe to the blog channel!
Hello. Add your message here.