mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-09 18:19:32 +02:00
Updated the headers
This commit is contained in:
parent
5fb4957e12
commit
80be672828
@ -1,11 +1,11 @@
|
|||||||
#!/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
|
||||||
# License: CC0
|
# License: CC0
|
||||||
#
|
|
||||||
param([string]$File)
|
param([string]$File)
|
||||||
$Result = get-filehash $File -algorithm MD5
|
$Result = get-filehash $File -algorithm MD5
|
||||||
write-host $Result.Hash
|
write-host $Result.Hash
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#!/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
|
||||||
# License: CC0
|
# License: CC0
|
||||||
#
|
|
||||||
param([string]$File)
|
param([string]$File)
|
||||||
$Result = get-filehash $File -algorithm SHA1
|
$Result = get-filehash $File -algorithm SHA1
|
||||||
write-host $Result.Hash
|
write-host $Result.Hash
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#!/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
|
||||||
# License: CC0
|
# License: CC0
|
||||||
#
|
|
||||||
param([string]$File)
|
param([string]$File)
|
||||||
$Result = get-filehash $File -algorithm SHA256
|
$Result = get-filehash $File -algorithm SHA256
|
||||||
write-host $Result.Hash
|
write-host $Result.Hash
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
#!/snap/bin/powershell
|
||||||
|
#
|
||||||
|
# Syntax: ./calculator.ps1
|
||||||
|
# Description: starts a calculator (GUI)
|
||||||
|
# Author: Markus Fleschutz
|
||||||
|
# Source: github.com/fleschutz/PowerShell
|
||||||
|
# License: CC0
|
||||||
|
|
||||||
clear-host
|
clear-host
|
||||||
write-host " PowerShell Calculator " -for green
|
write-host " PowerShell Calculator " -for green
|
||||||
write-host ""
|
write-host ""
|
||||||
|
@ -1,4 +1,11 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
|
#
|
||||||
|
# Syntax: ./crash_dumps.ps1
|
||||||
|
# Description: enables crash dumps
|
||||||
|
# Author: Markus Fleschutz
|
||||||
|
# Source: github.com/fleschutz/PowerShell
|
||||||
|
# License: CC0
|
||||||
|
|
||||||
##################################################################
|
##################################################################
|
||||||
# #
|
# #
|
||||||
# Written by: Ryan Waters #
|
# Written by: Ryan Waters #
|
||||||
|
@ -1,4 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/snap/bin/powershell
|
||||||
|
#
|
||||||
|
# Syntax: ./download_homepage.ps1
|
||||||
|
# Description: downloads from the given URL
|
||||||
|
# Author: Markus Fleschutz
|
||||||
|
# Source: github.com/fleschutz/PowerShell
|
||||||
|
# License: CC0
|
||||||
|
|
||||||
backup()
|
backup()
|
||||||
{
|
{
|
||||||
@ -7,3 +13,4 @@ backup()
|
|||||||
}
|
}
|
||||||
|
|
||||||
backup $1
|
backup $1
|
||||||
|
exit 0
|
||||||
|
@ -1,4 +1,12 @@
|
|||||||
mtpServer = "smtp.example.com"
|
#!/snap/bin/powershell
|
||||||
|
#
|
||||||
|
# Syntax: ./email.ps1
|
||||||
|
# Description: sends an email
|
||||||
|
# Author: Markus Fleschutz
|
||||||
|
# Source: github.com/fleschutz/PowerShell
|
||||||
|
# License: CC0
|
||||||
|
|
||||||
|
$smtpServer = "smtp.example.com"
|
||||||
$msg = new-object Net.Mail.MailMessage
|
$msg = new-object Net.Mail.MailMessage
|
||||||
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
|
$smtp = new-object Net.Mail.SmtpClient($smtpServer)
|
||||||
$msg.From = "me@example.com"
|
$msg.From = "me@example.com"
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
#
|
#
|
||||||
# Syntax: exe_info.ps1 <file>
|
# Syntax: ./exe_info.ps1 <file>
|
||||||
# Description: prints basic information of the given executable file
|
# Description: prints basic information of the given executable file
|
||||||
# Author: Markus Fleschutz
|
# Author: Markus Fleschutz
|
||||||
# Source: github.com/fleschutz/PowerShell
|
# Source: github.com/fleschutz/PowerShell
|
||||||
# License: CC0
|
# License: CC0
|
||||||
#
|
|
||||||
param([string]$File)
|
param([string]$File)
|
||||||
get-childitem $File | % {$_.VersionInfo} | Select *
|
get-childitem $File | % {$_.VersionInfo} | Select *
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
#
|
#
|
||||||
|
# Syntax: ./init_git.ps1
|
||||||
# Description: initializes Git
|
# Description: initializes Git
|
||||||
# Author: Markus Fleschutz
|
# Author: Markus Fleschutz
|
||||||
# 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): "
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
#
|
#
|
||||||
# Syntax: lscmdlets.ps1
|
# Syntax: ./lscmdlets.ps1
|
||||||
# Description: lists all PowerShell cmdlets
|
# Description: lists all PowerShell cmdlets
|
||||||
# Author: Markus Fleschutz
|
# Author: Markus Fleschutz
|
||||||
# Source: github.com/fleschutz/PowerShell
|
# Source: github.com/fleschutz/PowerShell
|
||||||
# License: CC0
|
# License: CC0
|
||||||
#
|
|
||||||
Get-Command -Command-Type cmdlet
|
Get-Command -Command-Type cmdlet
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
#
|
#
|
||||||
# Syntax: lsmods.ps1
|
# Syntax: ./lsmods.ps1
|
||||||
# Description: lists all PowerShell modules
|
# Description: lists all PowerShell modules
|
||||||
# Author: Markus Fleschutz
|
# Author: Markus Fleschutz
|
||||||
# Source: github.com/fleschutz/PowerShell
|
# Source: github.com/fleschutz/PowerShell
|
||||||
# License: CC0
|
# License: CC0
|
||||||
#
|
|
||||||
Get-Module
|
Get-Module
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
#
|
#
|
||||||
# Syntax: lsproc.ps1
|
# Syntax: ./lsproc.ps1
|
||||||
# Description: lists the local computer processes
|
# Description: lists the local computer processes
|
||||||
# Author: Markus Fleschutz
|
# Author: Markus Fleschutz
|
||||||
# Source: github.com/fleschutz/PowerShell
|
# Source: github.com/fleschutz/PowerShell
|
||||||
# License: CC0
|
# License: CC0
|
||||||
#
|
|
||||||
Get-Process | Format-Table -Property Id, @{Label="CPU(s)";Expression={$_.CPU.ToString("N")+"%"};Alignment="Right"}, ProcessName -AutoSize
|
Get-Process | Format-Table -Property Id, @{Label="CPU(s)";Expression={$_.CPU.ToString("N")+"%"};Alignment="Right"}, ProcessName -AutoSize
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
#
|
#
|
||||||
# Syntax: moon
|
# Syntax: ./moon.ps1
|
||||||
# Description: prints the current moon phase
|
# Description: prints the current moon phase
|
||||||
# Author: Markus Fleschutz
|
# Author: Markus Fleschutz
|
||||||
# Source: github.com/fleschutz/PowerShell
|
# Source: github.com/fleschutz/PowerShell
|
||||||
# License: CC0
|
# License: CC0
|
||||||
#
|
|
||||||
(Invoke-WebRequest http://wttr.in/Moon -UserAgent "curl" ).Content
|
(Invoke-WebRequest http://wttr.in/Moon -UserAgent "curl" ).Content
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
#
|
#
|
||||||
# Syntax: news.ps1
|
# Syntax: ./news.ps1
|
||||||
# Description: print the latest news
|
# Description: print the latest news
|
||||||
# Author: Markus Fleschutz
|
# Author: Markus Fleschutz
|
||||||
# Source: github.com/fleschutz/PowerShell
|
# Source: github.com/fleschutz/PowerShell
|
||||||
# License: CC0
|
# License: CC0
|
||||||
#
|
|
||||||
|
|
||||||
#$RSS_URL = "http://feeds.skynews.com/feeds/rss/world.xml"
|
#$RSS_URL = "http://feeds.skynews.com/feeds/rss/world.xml"
|
||||||
$RSS_URL = "https://yahoo.com/news/rss/world"
|
$RSS_URL = "https://yahoo.com/news/rss/world"
|
||||||
@ -20,5 +19,4 @@ write-host ""
|
|||||||
foreach ($item in $FileContent.rss.channel.item) {
|
foreach ($item in $FileContent.rss.channel.item) {
|
||||||
write-host "* "$item.title
|
write-host "* "$item.title
|
||||||
}
|
}
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
#
|
#
|
||||||
|
# Syntax: ./password.ps1
|
||||||
# Description: generates and prints a single new password
|
# Description: generates and prints a single new password
|
||||||
# Author: Markus Fleschutz
|
# Author: Markus Fleschutz
|
||||||
# Source: github.com/fleschutz/PowerShell
|
# Source: github.com/fleschutz/PowerShell
|
||||||
# License: CC0
|
# License: CC0
|
||||||
#
|
|
||||||
$CharsPerPassword = 15
|
$CharsPerPassword = 15
|
||||||
$MinCharCode = 33
|
$MinCharCode = 33
|
||||||
$MaxCharCode = 126
|
$MaxCharCode = 126
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
#
|
#
|
||||||
|
# Syntax: ./passwords.ps1
|
||||||
# Description: generates and prints a list of new passwords
|
# Description: generates and prints a list of new passwords
|
||||||
# Author: Markus Fleschutz
|
# Author: Markus Fleschutz
|
||||||
# Source: github.com/fleschutz/PowerShell
|
# Source: github.com/fleschutz/PowerShell
|
||||||
# License: CC0
|
# License: CC0
|
||||||
#
|
|
||||||
$NumPasswords = 20
|
$NumPasswords = 20
|
||||||
$CharsPerPassword = 15
|
$CharsPerPassword = 15
|
||||||
$MinCharCode = 33
|
$MinCharCode = 33
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
#
|
#
|
||||||
|
# Syntax: ./poweroff.ps1
|
||||||
# Description: halts the local computer, administrator rights are required
|
# Description: halts the local computer, administrator rights are required
|
||||||
# Author: Markus Fleschutz
|
# Author: Markus Fleschutz
|
||||||
# Source: github.com/fleschutz/PowerShell
|
# Source: github.com/fleschutz/PowerShell
|
||||||
# License: CC0
|
# License: CC0
|
||||||
#
|
|
||||||
#Requires -RunAsAdministrator
|
#Requires -RunAsAdministrator
|
||||||
Stop-Computer
|
Stop-Computer
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
#
|
#
|
||||||
|
# Syntax: ./reboot.ps1
|
||||||
# Description: reboots the local computer, administrator rights are required
|
# Description: reboots the local computer, administrator rights are required
|
||||||
# Author: Markus Fleschutz
|
# Author: Markus Fleschutz
|
||||||
# Source: github.com/fleschutz/PowerShell
|
# Source: github.com/fleschutz/PowerShell
|
||||||
# License: CC0
|
# License: CC0
|
||||||
#
|
|
||||||
#Requires -RunAsAdministrator
|
#Requires -RunAsAdministrator
|
||||||
Restart-Computer
|
Restart-Computer
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
#
|
#
|
||||||
|
# Syntax: ./speak.ps1
|
||||||
# Description: speaks the given text
|
# Description: speaks the given text
|
||||||
# Author: Markus Fleschutz
|
# Author: Markus Fleschutz
|
||||||
# Source: github.com/fleschutz/PowerShell
|
# Source: github.com/fleschutz/PowerShell
|
||||||
# License: CC0
|
# License: CC0
|
||||||
#
|
|
||||||
$Text = "Hello World!"
|
|
||||||
|
|
||||||
|
$Text = "Hello World!"
|
||||||
$voice = New-Object ComObject SAPI.SPVoice
|
$voice = New-Object ComObject SAPI.SPVoice
|
||||||
$voice.Speak($Text);
|
$voice.Speak($Text);
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
# Author: Markus Fleschutz
|
# Author: Markus Fleschutz
|
||||||
# Source: github.com/fleschutz/PowerShell
|
# Source: github.com/fleschutz/PowerShell
|
||||||
# License: CC0
|
# License: CC0
|
||||||
#
|
|
||||||
write-output "✔️ PowerShell works. Details are:"
|
write-output "✔️ PowerShell works. Details are:"
|
||||||
echo $PSVersionTable
|
echo $PSVersionTable
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
#
|
#
|
||||||
# Syntax: train_dns_cache
|
# Syntax: ./train_dns_cache.ps1
|
||||||
# Description: trains the DNS cache with frequently used domain names
|
# Description: trains the DNS cache with frequently used domain names
|
||||||
# Author: Markus Fleschutz
|
# Author: Markus Fleschutz
|
||||||
# Source: github.com/fleschutz/PowerShell
|
# Source: github.com/fleschutz/PowerShell
|
||||||
# License: CC0
|
# License: CC0
|
||||||
#
|
|
||||||
$Table = import-csv domain_table.csv
|
$Table = import-csv domain_table.csv
|
||||||
|
|
||||||
$StartTime = Get-Date
|
$StartTime = Get-Date
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
#
|
#
|
||||||
|
# Syntax: ./translate.ps1
|
||||||
# Description: translates the given text
|
# Description: translates the given text
|
||||||
# Author: Markus Fleschutz
|
# Author: Markus Fleschutz
|
||||||
# Source: github.com/fleschutz/PowerShell
|
# Source: github.com/fleschutz/PowerShell
|
||||||
# License: CC0
|
# License: CC0
|
||||||
#
|
|
||||||
$SourceText = "Hello World!"
|
$SourceText = "Hello World!"
|
||||||
$SourceLang = "en"
|
$SourceLang = "en"
|
||||||
$TargetLanguages = "af","da","de","el","es","hr","it","ja","ko","pl","pt","nl","ru","tr","uk","vi"
|
$TargetLanguages = "af","da","de","el","es","hr","it","ja","ko","pl","pt","nl","ru","tr","uk","vi"
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
#
|
#
|
||||||
|
# Syntax: ./txt2wav.ps1
|
||||||
# Description: converts the given text into an audio .WAV file
|
# Description: converts the given text into an audio .WAV file
|
||||||
# Author: Markus Fleschutz
|
# Author: Markus Fleschutz
|
||||||
# Source: github.com/fleschutz/PowerShell
|
# Source: github.com/fleschutz/PowerShell
|
||||||
# License: CC0
|
# License: CC0
|
||||||
#
|
|
||||||
# Configuration:
|
# Configuration:
|
||||||
$Text = "Hello, my name ist Bond, James Bond"
|
$Text = "Hello, my name ist Bond, James Bond"
|
||||||
$Speed = -1 # -10 is slowest, 10 is fastest
|
$Speed = -1 # -10 is slowest, 10 is fastest
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
#
|
#
|
||||||
|
# Syntax: ./wakeup.ps1
|
||||||
# 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
|
||||||
#
|
|
||||||
function Send-WOL
|
function Send-WOL
|
||||||
{
|
{
|
||||||
<#
|
<#
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
#
|
#
|
||||||
# Syntax: weather
|
# Syntax: ./weather.ps1
|
||||||
# Description: prints the current weather forecast
|
# Description: prints the current weather forecast
|
||||||
# Author: Markus Fleschutz
|
# Author: Markus Fleschutz
|
||||||
# Source: github.com/fleschutz/PowerShell
|
# Source: github.com/fleschutz/PowerShell
|
||||||
# License: CC0
|
# License: CC0
|
||||||
#
|
|
||||||
$GeoLocation="" # empty means determine automatically
|
$GeoLocation="" # empty means determine automatically
|
||||||
(Invoke-WebRequest http://wttr.in/$GeoLocation -UserAgent "curl" ).Content
|
(Invoke-WebRequest http://wttr.in/$GeoLocation -UserAgent "curl" ).Content
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
#!/snap/bin/powershell
|
#!/snap/bin/powershell
|
||||||
#
|
#
|
||||||
# Syntax: zipdir <path-to-folder>
|
# Syntax: ./zipdir.ps1 <path-to-folder>
|
||||||
# Description: creates a zip archive of the given folder
|
# Description: creates a zip archive from the given folder
|
||||||
# Author: Markus Fleschutz
|
# Author: Markus Fleschutz
|
||||||
# Source: github.com/fleschutz/PowerShell
|
# Source: github.com/fleschutz/PowerShell
|
||||||
# License: CC0
|
# License: CC0
|
||||||
#
|
|
||||||
param([string]$Path)
|
param([string]$Path)
|
||||||
Compress-Archive -Path $Path -DestinationPath $Path.zip
|
Compress-Archive -Path $Path -DestinationPath $Path.zip
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
Reference in New Issue
Block a user