mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-09 05:04:39 +02:00
Updated some scripts
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
|
|
||||||
# Syntax: ./MD5.ps1 <file>
|
# Syntax: ./MD5.ps1 [<file>]
|
||||||
# Description: prints the MD5 checksum of the given file
|
# Description: prints the MD5 checksum of the given file
|
||||||
# Author: Markus Fleschutz
|
# Author: Markus Fleschutz
|
||||||
# Source: github.com/fleschutz/PowerShell
|
# Source: github.com/fleschutz/PowerShell
|
||||||
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
param([string]$File)
|
param([string]$File)
|
||||||
if ($File -eq "" ) {
|
if ($File -eq "" ) {
|
||||||
$File = read-host "Enter file: "
|
$File = read-host "Enter file"
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
|
|
||||||
# Syntax: ./SHA1.ps1 <file>
|
# Syntax: ./SHA1.ps1 [<file>]
|
||||||
# Description: prints the SHA1 checksum of the given file
|
# Description: prints the SHA1 checksum of the given file
|
||||||
# Author: Markus Fleschutz
|
# Author: Markus Fleschutz
|
||||||
# Source: github.com/fleschutz/PowerShell
|
# Source: github.com/fleschutz/PowerShell
|
||||||
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
param([string]$File)
|
param([string]$File)
|
||||||
if ($File -eq "" ) {
|
if ($File -eq "" ) {
|
||||||
$File = read-host "Enter file: "
|
$File = read-host "Enter file"
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
|
|
||||||
# Syntax: ./SHA256.ps1 <file>
|
# Syntax: ./SHA256.ps1 [<file>]
|
||||||
# Description: prints the SHA256 checksum of the given file
|
# Description: prints the SHA256 checksum of the given file
|
||||||
# Author: Markus Fleschutz
|
# Author: Markus Fleschutz
|
||||||
# Source: github.com/fleschutz/PowerShell
|
# Source: github.com/fleschutz/PowerShell
|
||||||
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
param([string]$File)
|
param([string]$File)
|
||||||
if ($File -eq "" ) {
|
if ($File -eq "" ) {
|
||||||
$File = read-host "Enter file: "
|
$File = read-host "Enter file"
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
|
|
||||||
# Syntax: ./crash_dumps.ps1
|
# Syntax: ./crash_dumps.ps1
|
||||||
# Description: enables crash dumps
|
# Description: enables crash dumps
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
|
|
||||||
# Syntax: ./download.ps1 <URL>
|
# Syntax: ./download.ps1 [<URL>]
|
||||||
# Description: downloads the file/directory from the given URL
|
# Description: downloads the file/directory from the given URL
|
||||||
# Author: Markus Fleschutz
|
# Author: Markus Fleschutz
|
||||||
# Source: github.com/fleschutz/PowerShell
|
# Source: github.com/fleschutz/PowerShell
|
||||||
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
param([string]$URL)
|
param([string]$URL)
|
||||||
if ($URL -eq "" ) {
|
if ($URL -eq "" ) {
|
||||||
$URL = read-host "Enter URL to download: "
|
$URL = read-host "Enter URL to download"
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -6,9 +6,9 @@
|
|||||||
# Source: github.com/fleschutz/PowerShell
|
# Source: github.com/fleschutz/PowerShell
|
||||||
# License: CC0
|
# License: CC0
|
||||||
|
|
||||||
$UserName = read-host "Your full name: "
|
$UserName = read-host "Your full name"
|
||||||
$UserEmail = read-host "Your email address: "
|
$UserEmail = read-host "Your email address"
|
||||||
$UserEditor = read-host "Your favorite editor (nano, vi, emacs): "
|
$UserEditor = read-host "Your favorite editor (nano, vi, emacs)"
|
||||||
|
|
||||||
try {
|
try {
|
||||||
git config --global user.name $UserName
|
git config --global user.name $UserName
|
||||||
|
@ -1,14 +1,18 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
|
|
||||||
# Syntax: ./latlong.ps1 <city>
|
# Syntax: ./latlong.ps1 [<city>]
|
||||||
# Description: prints the lat/long coordinates of the given city
|
# Description: prints the lat/long coordinates of the given city
|
||||||
# Author: Markus Fleschutz
|
# Author: Markus Fleschutz
|
||||||
# Source: github.com/fleschutz/PowerShell
|
# Source: github.com/fleschutz/PowerShell
|
||||||
# License: CC0
|
# License: CC0
|
||||||
|
|
||||||
param([string]$City)
|
param([string]$City)
|
||||||
|
if ($City -eq "" ) {
|
||||||
|
$City = read-host "Enter city"
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
write-progress "Reading worldcities.csv..."
|
||||||
$Table = import-csv worldcities.csv
|
$Table = import-csv worldcities.csv
|
||||||
$FoundOne = 0
|
$FoundOne = 0
|
||||||
foreach($Row in $Table) {
|
foreach($Row in $Table) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
|
|
||||||
# Syntax: ./test.ps1
|
# Syntax: ./test.ps1
|
||||||
# Description: simple PowerShell test script
|
# Description: simple PowerShell test script
|
||||||
|
@ -12,7 +12,7 @@ try {
|
|||||||
$Table = import-csv domain_table.csv
|
$Table = import-csv domain_table.csv
|
||||||
foreach($Row in $Table) {
|
foreach($Row in $Table) {
|
||||||
$Domain = $Row.Domain
|
$Domain = $Row.Domain
|
||||||
write-progress "Training DNS cache with $Domain ..."
|
write-progress "Training DNS cache with $Domain..."
|
||||||
$Ignore = nslookup $Domain
|
$Ignore = nslookup $Domain
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,11 +1,16 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
|
|
||||||
# Syntax: ./wakeup.ps1
|
# Syntax: ./wakeup.ps1 [<hostname>]
|
||||||
# Description: sends a magic packet to the given computer, waking him up
|
# Description: sends a magic packet to the given computer, waking him up
|
||||||
# Author: Markus Fleschutz
|
# Author: Markus Fleschutz
|
||||||
# Source: github.com/fleschutz/PowerShell
|
# Source: github.com/fleschutz/PowerShell
|
||||||
# License: CC0
|
# License: CC0
|
||||||
|
|
||||||
|
param([string]$Hostname)
|
||||||
|
if ($Hostname -eq "" ) {
|
||||||
|
$Hostname = read-host "Enter hostname"
|
||||||
|
}
|
||||||
|
|
||||||
function Send-WOL
|
function Send-WOL
|
||||||
{
|
{
|
||||||
<#
|
<#
|
||||||
@ -39,7 +44,6 @@ $UDPclient.Connect($broadcast,$port)
|
|||||||
[void]$UDPclient.Send($packet, 102)
|
[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"
|
$MyMACAddresses = "io=11:22:33:44:55:66","pi=11:22:33:44:55:66"
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
Reference in New Issue
Block a user