Updated some scripts

This commit is contained in:
Markus Fleschutz
2020-11-06 14:30:14 +00:00
parent 0ffef56c95
commit 946e76a5ca
11 changed files with 227 additions and 219 deletions

View File

@ -1,6 +1,6 @@
#!/snap/bin/powershell
# Syntax: ./MD5.ps1 <file>
# Syntax: ./MD5.ps1 [<file>]
# Description: prints the MD5 checksum of the given file
# Author: Markus Fleschutz
# Source: github.com/fleschutz/PowerShell
@ -8,7 +8,7 @@
param([string]$File)
if ($File -eq "" ) {
$File = read-host "Enter file: "
$File = read-host "Enter file"
}
try {

View File

@ -1,6 +1,6 @@
#!/snap/bin/powershell
# Syntax: ./SHA1.ps1 <file>
# Syntax: ./SHA1.ps1 [<file>]
# Description: prints the SHA1 checksum of the given file
# Author: Markus Fleschutz
# Source: github.com/fleschutz/PowerShell
@ -8,7 +8,7 @@
param([string]$File)
if ($File -eq "" ) {
$File = read-host "Enter file: "
$File = read-host "Enter file"
}
try {

View File

@ -1,6 +1,6 @@
#!/snap/bin/powershell
# Syntax: ./SHA256.ps1 <file>
# Syntax: ./SHA256.ps1 [<file>]
# Description: prints the SHA256 checksum of the given file
# Author: Markus Fleschutz
# Source: github.com/fleschutz/PowerShell
@ -8,7 +8,7 @@
param([string]$File)
if ($File -eq "" ) {
$File = read-host "Enter file: "
$File = read-host "Enter file"
}
try {

View File

@ -1,4 +1,4 @@
#!/snap/bin/powershell
#!/snap/bin/powershell
# Syntax: ./crash_dumps.ps1
# Description: enables crash dumps

View File

@ -1,6 +1,6 @@
#!/snap/bin/powershell
# Syntax: ./download.ps1 <URL>
# Syntax: ./download.ps1 [<URL>]
# Description: downloads the file/directory from the given URL
# Author: Markus Fleschutz
# Source: github.com/fleschutz/PowerShell
@ -8,7 +8,7 @@
param([string]$URL)
if ($URL -eq "" ) {
$URL = read-host "Enter URL to download: "
$URL = read-host "Enter URL to download"
}
try {

View File

@ -6,9 +6,9 @@
# Source: github.com/fleschutz/PowerShell
# License: CC0
$UserName = read-host "Your full name: "
$UserEmail = read-host "Your email address: "
$UserEditor = read-host "Your favorite editor (nano, vi, emacs): "
$UserName = read-host "Your full name"
$UserEmail = read-host "Your email address"
$UserEditor = read-host "Your favorite editor (nano, vi, emacs)"
try {
git config --global user.name $UserName

View File

@ -1,14 +1,18 @@
#!/snap/bin/powershell
# Syntax: ./latlong.ps1 <city>
# Syntax: ./latlong.ps1 [<city>]
# Description: prints the lat/long coordinates of the given city
# Author: Markus Fleschutz
# Source: github.com/fleschutz/PowerShell
# License: CC0
param([string]$City)
if ($City -eq "" ) {
$City = read-host "Enter city"
}
try {
write-progress "Reading worldcities.csv..."
$Table = import-csv worldcities.csv
$FoundOne = 0
foreach($Row in $Table) {

View File

@ -1,4 +1,4 @@
#!/snap/bin/powershell
#!/snap/bin/powershell
# Syntax: ./test.ps1
# Description: simple PowerShell test script

View File

@ -12,7 +12,7 @@ try {
$Table = import-csv domain_table.csv
foreach($Row in $Table) {
$Domain = $Row.Domain
write-progress "Training DNS cache with $Domain ..."
write-progress "Training DNS cache with $Domain..."
$Ignore = nslookup $Domain
}

View File

@ -1,11 +1,16 @@
#!/snap/bin/powershell
# Syntax: ./wakeup.ps1
# Syntax: ./wakeup.ps1 [<hostname>]
# Description: sends a magic packet to the given computer, waking him up
# Author: Markus Fleschutz
# Source: github.com/fleschutz/PowerShell
# License: CC0
param([string]$Hostname)
if ($Hostname -eq "" ) {
$Hostname = read-host "Enter hostname"
}
function Send-WOL
{
<#
@ -39,7 +44,6 @@ $UDPclient.Connect($broadcast,$port)
[void]$UDPclient.Send($packet, 102)
}
$Hostname = read-host "Enter hostname: "
$MyMACAddresses = "io=11:22:33:44:55:66","pi=11:22:33:44:55:66"
try {