Add new file
This commit is contained in:
22
signed gpg license key.ps1
Normal file
22
signed gpg license key.ps1
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
Function Get-RandomAlphanumericString {
|
||||||
|
|
||||||
|
[CmdletBinding()]
|
||||||
|
Param (
|
||||||
|
[int] $length = 5
|
||||||
|
)
|
||||||
|
# Numbers: (0x30..0x39)
|
||||||
|
# Lower Case: ( 0x61..0x7A)
|
||||||
|
# Upper Case: ( 0x41..0x5A)
|
||||||
|
return ( -join ((0x30..0x39) + ( 0x41..0x5A) | Get-Random -Count $length | % {[char]$_}) )
|
||||||
|
}
|
||||||
|
$key = ""
|
||||||
|
(1..5) | % {
|
||||||
|
if ($_ -eq 5) {
|
||||||
|
$key += (Get-RandomAlphanumericString)
|
||||||
|
$key = "License Key: " + $key
|
||||||
|
} else {
|
||||||
|
$key += (Get-RandomAlphanumericString) + "-"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$key | gpg --clearsign > ./license.key
|
||||||
Reference in New Issue
Block a user