mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-09 18:19:32 +02:00
Update generate-qrcode.ps1
This commit is contained in:
parent
a9d9abd9b9
commit
23612569c1
@ -6,14 +6,15 @@
|
|||||||
.NOTES Author: Markus Fleschutz / License: CC0
|
.NOTES Author: Markus Fleschutz / License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
param([string]$Text = "", $ImageSize = "")
|
param($Text = "", $ImageSize = "")
|
||||||
|
|
||||||
|
try {
|
||||||
if ($Text -eq "") {
|
if ($Text -eq "") {
|
||||||
$Text = read-input "Enter text or URL"
|
$Text = read-input "Enter text or URL"
|
||||||
}
|
}
|
||||||
if ($ImageSize -eq "") {
|
if ($ImageSize -eq "") {
|
||||||
$ImageSize = read-input "Enter image size (e.g. 500x500)"
|
$ImageSize = read-input "Enter image size (e.g. 500x500)"
|
||||||
}
|
}
|
||||||
|
|
||||||
$ECC = "M" # can be L, M, Q, H
|
$ECC = "M" # can be L, M, Q, H
|
||||||
$QuietZone = 1
|
$QuietZone = 1
|
||||||
$ForegroundColor = "000000"
|
$ForegroundColor = "000000"
|
||||||
@ -22,7 +23,6 @@ $FileFormat = "jpg"
|
|||||||
$PathToRepo = "$PSScriptRoot/.."
|
$PathToRepo = "$PSScriptRoot/.."
|
||||||
$NewFile = "$PathToRepo/Data/qrcode.jpg"
|
$NewFile = "$PathToRepo/Data/qrcode.jpg"
|
||||||
|
|
||||||
try {
|
|
||||||
$WebClient = new-object System.Net.WebClient
|
$WebClient = new-object System.Net.WebClient
|
||||||
$WebClient.DownloadFile(("http://api.qrserver.com/v1/create-qr-code/?data=" + $Text + "&ecc=" + $ECC +`
|
$WebClient.DownloadFile(("http://api.qrserver.com/v1/create-qr-code/?data=" + $Text + "&ecc=" + $ECC +`
|
||||||
"&size=" + $ImageSize + "&qzone=" + $QuietZone + `
|
"&size=" + $ImageSize + "&qzone=" + $QuietZone + `
|
||||||
|
Loading…
Reference in New Issue
Block a user