QR codes and practical usage


Earlier this year I was lucky to attend the PowerShell Conference Europe (a.k.a. PSConfEU), which is easily the geek highlight of my year.

At the Opening ceremony, organizer and PowerShell GURU Dr. Tobias Weltner showed this gem that amazed me in it’s simplicity

As the name implies, the QRCodeGenerator will generate various QR codes for you to use, all through the magic of PowerShell [and of course the QR generator solution in C# which this module uses].

Of course now we’ll want to play with it, so let’s get the module!

Let’s just assume by now you’ll have at least (Windows) PowerShell 5+, if you don’t, please get it ASAP [or get PowerShell Core instead]!

1
Find-Module -Name QRCodeGenerator

When searching the PowerShellGallery, you should be presented by the last version

install
install

Go ahead and install this module for yourself

1
Find-Module -Name QRCodeGenerator | Install-Module -Scope CurrentUser

or for everyone on your system [be sure to run PowerShell as Administrator]

1
Find-Module -Name QRCodeGenerator | Install-Module -Scope AllUsers

Let’s see what options we have available

1
Get-Command -Module QRCodeGenerator

cmdlets
cmdlets

So we can create a new

  • GeoLocation QR Code
  • vCard QR Code
  • Wifi Access QR Code

As expected, each of the provided cmdlets come with properly created help files, examples and all 3 cmdlets have similar input parameters, mainly

  • Width - height and width of the generated code [default is 100]
  • Show - open the generated code in default program
  • OutPath - path to generated png file. If left empty, a temporary file name will be used.

To be honest, the 2 main reasons I liked this are the Wifi Access and vCard codes. While there might be some use for the GeoLocation one, I would think it’d mainly be in like print media, to display your company’s location information or such.

The New-QRCodeWifiAccess cmdlet can be used at home or at work provide access to your guest wifi network. Simply generate the code, print and laminate it once and whenever people ask for access, just let them scan the code!

1
New-QRCodeWifiAccess -SSID Contoso-guest -Password '#InsertRandomKeyPhraseForGuestsHere' -Show

And tada!

wifi
wifi

As for the New-QRCodevCard cmdlet, it works just the same. In this case I would recommend using it on your business card to allow your contact to easily add you in her/her phone.

1
New-QRCodeVCard -FirstName Foo -LastName Bar -Company FUBAR -Email mailme@fubar.org -Show

vcard
vcard

All in all, I thought this was thing to share, I hope you think so too!

Happy Scripting! 🙂