mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-09 09:48:21 +02:00
Updated the scripts
This commit is contained in:
parent
e12f1961b4
commit
c3c17e48d7
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./MD5.ps1 <file>
|
||||
# Description: prints the MD5 checksum of the given file
|
||||
# Author: Markus Fleschutz
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./SHA1.ps1 <file>
|
||||
# Description: prints the SHA1 checksum of the given file
|
||||
# Author: Markus Fleschutz
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./SHA256.ps1 <file>
|
||||
# Description: prints the SHA256 checksum of the given file
|
||||
# Author: Markus Fleschutz
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./calculator.ps1
|
||||
# Description: starts a calculator (GUI)
|
||||
# Author: Markus Fleschutz
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./crash_dumps.ps1
|
||||
# Description: enables crash dumps
|
||||
# Author: Markus Fleschutz
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./download.ps1 <URL>
|
||||
# Description: downloads the file/directory from the given URL
|
||||
# Author: Markus Fleschutz
|
||||
@ -8,7 +8,6 @@
|
||||
|
||||
param([string]$URL)
|
||||
|
||||
|
||||
try {
|
||||
wget --mirror --convert-links --adjust-extension --page-requisites --no-parent $URL --directory-prefix . --no-verbose
|
||||
exit 0
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./email.ps1
|
||||
# Description: sends an email
|
||||
# Author: Markus Fleschutz
|
||||
|
@ -1,10 +1,9 @@
|
||||
#!/snap/bin/powershell
|
||||
::
|
||||
:: Syntax: empty-dir.ps1 <dir>
|
||||
:: Description: Empties the given directory. The content is removed!
|
||||
:: Author: Markus Fleschutz
|
||||
:: License: CC0
|
||||
::
|
||||
|
||||
:: TODO
|
||||
# Syntax: empty-dir.ps1 <dir>
|
||||
# Description: Empties the given directory. The content is removed!
|
||||
# Author: Markus Fleschutz
|
||||
# License: CC0
|
||||
|
||||
# TODO
|
||||
exit 0
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./exe_info.ps1 <file>
|
||||
# Description: prints basic information of the given executable file
|
||||
# Author: Markus Fleschutz
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./init_git.ps1
|
||||
# Description: initializes Git
|
||||
# Author: Markus Fleschutz
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./list-cmdlets.ps1
|
||||
# Description: lists all PowerShell cmdlets
|
||||
# Author: Markus Fleschutz
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./list-empty-dirs.ps1 <dirtree>
|
||||
# Description: lists empty subfolders in the <directory tree>
|
||||
# Author: Markus Fleschutz
|
||||
@ -11,7 +11,7 @@ param([string]$DirTree)
|
||||
write-host "Listing empty subfolders in $DirTree ..."
|
||||
|
||||
try {
|
||||
(gci $DirTree -r | ? {$_.PSIsContainer -eq $True}) | ?{$_.GetFileSystemInfos().Count -eq 0} | select FullName
|
||||
(Get-ChildItem $DirTree -recurse | ? {$_.PSIsContainer -eq $True}) | ?{$_.GetFileSystemInfos().Count -eq 0} | select FullName
|
||||
echo "Done."
|
||||
exit 0
|
||||
} catch { Write-Error $Error[0] }
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./list-modules.ps1
|
||||
# Description: lists all PowerShell modules
|
||||
# Author: Markus Fleschutz
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./list-processes.ps1
|
||||
# Description: lists the local computer processes
|
||||
# Author: Markus Fleschutz
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./list-unused-files.ps1 <dirtree> <days>
|
||||
# Description: lists files in the <directory tree> with last access time older than <days>
|
||||
# Author: Markus Fleschutz
|
||||
@ -13,7 +13,7 @@ write-host "Listing files in $DirTree with last access time older than $NumberOf
|
||||
try {
|
||||
$cutOffDate = (Get-Date).AddDays(-$NumberOfDaysUnused)
|
||||
|
||||
Get-ChildItem -Path $DirTree -Recurse | Where-Object {$_.LastAccessTime -le $cutOffDate} | select fullname
|
||||
Get-ChildItem -path $DirTree -recurse | Where-Object {$_.LastAccessTime -le $cutOffDate} | select fullname
|
||||
|
||||
exit 0
|
||||
} catch { Write-Error $Error[0] }
|
||||
|
@ -1,9 +1,9 @@
|
||||
#!/snap/bin/powershell
|
||||
::
|
||||
:: Syntax: make-install.ps1 <build-dir>
|
||||
:: Description: Copies newer EXE's + DLL's from the build directory to the installation directory.
|
||||
:: Author: Markus Fleschutz
|
||||
::
|
||||
|
||||
# Syntax: make-install.ps1 <build-dir>
|
||||
# Description: Copies newer EXE's + DLL's from the build directory to the installation directory.
|
||||
# Author: Markus Fleschutz
|
||||
# License: CC0
|
||||
|
||||
set SRC_DIR=%1
|
||||
set "DST_DIR=C:\Program Files\MyApp\bin"
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./moon.ps1
|
||||
# Description: prints the current moon phase
|
||||
# Author: Markus Fleschutz
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./news.ps1
|
||||
# Description: print the latest news
|
||||
# Author: Markus Fleschutz
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./password.ps1
|
||||
# Description: generates and prints a single new password
|
||||
# Author: Markus Fleschutz
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./passwords.ps1
|
||||
# Description: generates and prints a list of new passwords
|
||||
# Author: Markus Fleschutz
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./poweroff.ps1
|
||||
# Description: halts the local computer, administrator rights are required
|
||||
# Author: Markus Fleschutz
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./reboot.ps1
|
||||
# Description: reboots the local computer, administrator rights are required
|
||||
# Author: Markus Fleschutz
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./speak.ps1 [<text>]
|
||||
# Description: speaks the given text
|
||||
# Author: Markus Fleschutz
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./test.ps1
|
||||
# Description: simple PowerShell test script
|
||||
# Author: Markus Fleschutz
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./train-dns-cache.ps1
|
||||
# Description: trains the DNS cache with frequently used domain names
|
||||
# Author: Markus Fleschutz
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./translate.ps1
|
||||
# Description: translates the given text
|
||||
# Author: Markus Fleschutz
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./txt2wav.ps1
|
||||
# Description: converts the given text into an audio .WAV file
|
||||
# Author: Markus Fleschutz
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./wakeup.ps1
|
||||
# Description: sends a magic packet to the given computer, waking him up
|
||||
# Author: Markus Fleschutz
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./weather.ps1
|
||||
# Description: prints the current weather forecast
|
||||
# Author: Markus Fleschutz
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/snap/bin/powershell
|
||||
#
|
||||
|
||||
# Syntax: ./zipdir.ps1 <path-to-folder>
|
||||
# Description: creates a zip archive from the given folder
|
||||
# Author: Markus Fleschutz
|
||||
|
Loading…
Reference in New Issue
Block a user