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