mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-25 13:36:39 +01:00
Update generate-qrcode.ps1
This commit is contained in:
parent
a9d9abd9b9
commit
23612569c1
@ -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 + `
|
||||
|
Loading…
Reference in New Issue
Block a user