mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-22 07:53:21 +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
|
@ -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
|
||||
|
@ -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
|
||||
|
5
test.ps1
5
test.ps1
@ -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
|
||||
|
@ -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