mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-09 13:04:59 +02:00
Updated some scripts
This commit is contained in:
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/snap/bin/powershell
|
||||
#!/snap/bin/powershell
|
||||
|
||||
# Syntax: ./crash_dumps.ps1
|
||||
# Description: enables crash dumps
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/snap/bin/powershell
|
||||
#!/snap/bin/powershell
|
||||
|
||||
# Syntax: ./test.ps1
|
||||
# Description: simple PowerShell test script
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
Reference in New Issue
Block a user