Commit 983e9fd5 authored by Lukáš Zuzaňák's avatar Lukáš Zuzaňák

Upload new file

parent 3eb6a0e6
############################
# GENERATOR HESEL #
# Autor: Lukáš Zuzaňák #
############################
#Nastaveni domovskeho adresare pro POWERSHELL aby se mohl zkompilovat do EXE
$scriptRoot = [System.AppDomain]::CurrentDomain.BaseDirectory.TrimEnd('\')
if ($scriptRoot -eq $PSHOME.TrimEnd('\'))
{
$scriptRoot = $PSScriptRoot
}
#Vstupni hodnoty
write-host "GENERATOR HESLA by Lukas Zuzanak" -ForegroundColor Yellow
write-host "--------------------------------" -ForegroundColor Yellow
write-host ""
$pwdleng = read-host "Delka hesla"
#ZACATEK - generovani hesla
$Private:OFS = "" #nastaveni separatoru
$PasswordLength = $pwdleng #delka hesla
$InclChars = ‘abcdefghkmnprstuvwxyzABCDEFGHKLMNPRSTUVWXYZ123456789#&@$€-_?!’ #pouzite znaky pro heslo
$RandomNums = 1..$PasswordLength | ForEach-Object { Get-Random -Maximum $InclChars.length } #pouziti nahodnych znaku
$RandomPassword = [String]$InclChars[$RandomNums] #nacteni hesla do promenne
#KONEC - generovani hesla
#Vystup
write-host ""
write-host "--------------------------------" -ForegroundColor Yellow
write-host "Heslo:" $RandomPassword -ForegroundColor Cyan
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment