mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-22 16:03:22 +01:00
Added new_password.ps1
This commit is contained in:
parent
d8a596061e
commit
d1f44192ee
25
new_password.ps1
Normal file
25
new_password.ps1
Normal 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
|
@ -2,6 +2,8 @@
|
||||
# ------------------------------------------------
|
||||
# Author: Markus Fleschutz
|
||||
# Source: github.com/fleschutz/PowerShell
|
||||
# License: CC0
|
||||
#
|
||||
# NOTE: Halts the local computer! Administrator rights might be needed!
|
||||
|
||||
Stop-Computer
|
||||
|
@ -2,6 +2,8 @@
|
||||
# ----------------------------------------------
|
||||
# Author: Markus Fleschutz
|
||||
# Source: github.com/fleschutz/PowerShell
|
||||
# License: CC0
|
||||
#
|
||||
# NOTE: Reboots the local computer! Administrator rights might be needed.
|
||||
|
||||
Restart-Computer
|
||||
|
1
test.ps1
1
test.ps1
@ -2,6 +2,7 @@
|
||||
# -----------------------------
|
||||
# Author: Markus Fleschutz
|
||||
# Source: github.com/fleschutz/PowerShell
|
||||
# License: CC0
|
||||
|
||||
write-output "PowerShell Works!"
|
||||
exit 0
|
||||
|
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user