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
- Open a new PowerShell console as Administrator.
- Type or copy-paste the following command:
Install-Module -Name QRCodeGenerator
. Tip: See Fix Install-Module is missing in PowerShell. - Confirm the NuGet provider update if prompted (type "y").
- Next, confirm the installation from the 'PSGallery' repo. Again, enter "y".
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.
- Open a new PowerShell console.
- Change PowerShell Execution Policy to 'Unrestricted'. In short, run the command
Set-ExecutionPolicy Unrestricted -Scope Process
. - Confirm the command.
- Load the module with the next command:
Import-Module QRCodeGenerator
. - 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
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:
- Find Your Windows Upgrade History with PowerShell
- Create Windows 10 Bootable USB Stick With PowerShell
- Add PowerShell As Administrator Context Menu in Windows 10
- How to Get Weather Forecast In PowerShell
- Change network location type with PowerShell in Windows 10
- Get File Hash With PowerShell in Windows 10
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:
It works like a charm!
Have you thought about adding a standard URL as a QR-code to this program
It would be great if text and other QR codes could be added as a sub function.