Update generate-qrcode.ps1

This commit is contained in:
Markus Fleschutz 2021-02-12 12:19:44 +01:00 committed by GitHub
parent a9d9abd9b9
commit 23612569c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6,23 +6,23 @@
.NOTES Author: Markus Fleschutz / License: CC0
#>
param([string]$Text = "", $ImageSize = "")
if ($Text -eq "") {
$Text = read-input "Enter text or URL"
}
if ($ImageSize -eq "") {
$ImageSize = read-input "Enter image size (e.g. 500x500)"
}
$ECC = "M" # can be L, M, Q, H
$QuietZone = 1
$ForegroundColor = "000000"
$BackgroundColor = "ffffff"
$FileFormat = "jpg"
$PathToRepo = "$PSScriptRoot/.."
$NewFile = "$PathToRepo/Data/qrcode.jpg"
param($Text = "", $ImageSize = "")
try {
if ($Text -eq "") {
$Text = read-input "Enter text or URL"
}
if ($ImageSize -eq "") {
$ImageSize = read-input "Enter image size (e.g. 500x500)"
}
$ECC = "M" # can be L, M, Q, H
$QuietZone = 1
$ForegroundColor = "000000"
$BackgroundColor = "ffffff"
$FileFormat = "jpg"
$PathToRepo = "$PSScriptRoot/.."
$NewFile = "$PathToRepo/Data/qrcode.jpg"
$WebClient = new-object System.Net.WebClient
$WebClient.DownloadFile(("http://api.qrserver.com/v1/create-qr-code/?data=" + $Text + "&ecc=" + $ECC +`
"&size=" + $ImageSize + "&qzone=" + $QuietZone + `