Added new_password.ps1

This commit is contained in:
Markus Fleschutz 2020-05-02 12:35:58 +00:00
parent d8a596061e
commit d1f44192ee
5 changed files with 41 additions and 7 deletions

25
new_password.ps1 Normal file
View File

@ -0,0 +1,25 @@
# PowerShell Script to Create New Passwords
# -----------------------------------------
# Author: Markus Fleschutz
# Source: github.com/fleschutz/PowerShell
# License: CC0
$NumPasswords = 20
$CharsPerPassword = 15
$MinCharCode = 33
$MaxCharCode = 126
function new_password() {
$password = ""
$generator = New-Object System.Random
for ($i = 0; $i -lt $CharsPerPassword; $i++) {
$password = $password +[char]$generator.next($MinCharCode,$MaxCharCode)
}
return $password
}
for ($j = 0; $j -lt $NumPasswords; $j++) {
$password = new_password
write-output $password
}
exit 0

View File

@ -1,7 +1,9 @@
# PowerShell Script to Shutdown the Local Computer
# ------------------------------------------------
# Author: Markus Fleschutz
# Source: github.com/fleschutz/PowerShell
# Author: Markus Fleschutz
# Source: github.com/fleschutz/PowerShell
# License: CC0
#
# NOTE: Halts the local computer! Administrator rights might be needed!
Stop-Computer

View File

@ -1,7 +1,9 @@
# PowerShell Script to Reboot the Local Computer
# ----------------------------------------------
# Author: Markus Fleschutz
# Source: github.com/fleschutz/PowerShell
# Author: Markus Fleschutz
# Source: github.com/fleschutz/PowerShell
# License: CC0
#
# NOTE: Reboots the local computer! Administrator rights might be needed.
Restart-Computer

View File

@ -1,7 +1,8 @@
# PowerShell Script for Testing
# -----------------------------
# Author: Markus Fleschutz
# Source: github.com/fleschutz/PowerShell
# Author: Markus Fleschutz
# Source: github.com/fleschutz/PowerShell
# License: CC0
write-output "PowerShell Works!"
exit 0

View File

@ -1,4 +1,8 @@
# PowerShell script
# PowerShell Script to Wake-up Other Computers
# --------------------------------------------
# Author: Markus Fleschutz
# Source: github.com/fleschutz/PowerShell
# License: CC0
function Send-WOL
{