Skip to content

Commit

Permalink
Merge pull request #6 from T0biii/master
Browse files Browse the repository at this point in the history
add #3 (New-PSOneQRCodeURI)
  • Loading branch information
TobiasPSP authored Jan 8, 2021
2 parents 756f966 + 1c0d0b3 commit 635e92b
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 4 deletions.
59 changes: 59 additions & 0 deletions QRCodeGenerator/2.4.0/New-PSOneQRCodeURI.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
function New-PSOneQRCodeURI
{
<#
.SYNOPSIS
Creates a QR code graphic containing a URI
.DESCRIPTION
Creates a QR code graphic in png format that - when scanned by a smart device - opens a URI/URL in your webapp
.PARAMETER URI
The URI
.PARAMETER Width
Height and Width of generated graphics (in pixels). Default is 100.
.PARAMETER Show
Opens the generated QR code in associated program
.PARAMETER OutPath
Path to generated png file. When omitted, a temporary file name is used.
.EXAMPLE
New-PSOneQRCodeURI -URI "https://github.com/TobiasPSP/Modules.QRCodeGenerator" -Width 50 -Show -OutPath "$home\Desktop\qr.png"
Creates a QR code png graphics on your desktop, and opens it with the associated program
.NOTES
Compatible with all PowerShell versions including PowerShell 6/Core
Uses binaries from https://github.com/codebude/QRCoder/wiki
.LINK
https://github.com/TobiasPSP/Modules.QRCodeGenerator
#>

[CmdletBinding()]
param
(
[Parameter(Mandatory)]
[alias("URL")]
[System.Uri]
$URI,

[ValidateRange(10,2000)]
[int]
$Width = 100,

[Switch]
$Show,

[string]
$OutPath = "$env:temp\qrcode.png"
)

$payload = @"
$($URI.AbsoluteUri)
"@

New-PSOneQRCode -payload $payload -Show $Show -Width $Width -OutPath $OutPath
}
6 changes: 3 additions & 3 deletions QRCodeGenerator/2.4.0/QRCodeGenerator.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ Copyright = '2021 Dr. Tobias Weltner (MIT-License)'
Description = 'creates QR codes offline'
PowerShellVersion = '5.1'
FunctionsToExport = 'New-PSOneQRCodeGeolocation', 'New-PSOneQRCodeTwitter',
'New-PSOneQRCodeWifiAccess', 'New-PSOneQRCodeVCard', 'New-PSOneQRCodeText'
'New-PSOneQRCodeWifiAccess', 'New-PSOneQRCodeVCard', 'New-PSOneQRCodeText' , 'New-PSOneQRCodeURI'
CmdletsToExport = '*'
VariablesToExport = '*'
AliasesToExport = 'New-QRCodeGeolocation', 'New-QRCodeTwitter', 'New-QRCodeVCard',
'New-QRCodeWifiAccess', 'New-QRCodeText'
'New-QRCodeWifiAccess', 'New-QRCodeText', 'New-QRCodeURI'
PrivateData = @{
PSData = @{
Tags = 'QRCode', 'powershell.one'
LicenseUri = 'https://en.wikipedia.org/wiki/MIT_License'
ProjectUri = 'https://github.com/TobiasPSP/Modules.QRCodeGenerator'
ReleaseNotes = 'added new Method New-QRCodeText'
ReleaseNotes = 'added new Methods New-QRCodeText and New-QRCodeURI'
}
}
}
3 changes: 2 additions & 1 deletion QRCodeGenerator/2.4.0/aliases.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ Set-Alias -Name New-QRCodeGeolocation -Value New-PSOneQRCodeGeolocation
Set-Alias -Name New-QRCodeWifiAccess -Value New-PSOneQRCodeWifiAccess
Set-Alias -Name New-QRCodeTwitter -Value New-PSOneQRCodeTwitter
Set-Alias -Name New-QRCodeVCard -Value New-PSOneQRCodeVCard
Set-Alias -Name New-QRCodeText -Value New-PSOneQRCodeText
Set-Alias -Name New-QRCodeText -Value New-PSOneQRCodeText
Set-Alias -Name New-QRCodeURI -Value New-PSOneQRCodeURI
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ New-QRCodeText
New-QRCodeTwitter
New-QRCodeVCard
New-QRCodeWifiAccess
New-QRCodeURI
```

0 comments on commit 635e92b

Please sign in to comment.