Improve the .Example section

This commit is contained in:
Markus Fleschutz 2023-08-06 21:35:36 +02:00
parent 18e4f20852
commit fa9d43b715
244 changed files with 457 additions and 433 deletions

View File

@ -6,7 +6,7 @@
.PARAMETER PathToExecutables
Specifies the path to the executables
.EXAMPLE
PS> ./add-firewall-rules C:\MyApp\bin
PS> ./add-firewall-rules.ps1 C:\MyApp\bin
Adding firewall rule for C:\MyApp\bin\app1.exe
Adding firewall rule for C:\MyApp\bin\app2.exe
...

View File

@ -6,7 +6,7 @@
.PARAMETER text
Specifies the text to memorize
.EXAMPLE
PS> ./add-memo "Buy apples"
PS> ./add-memo.ps1 "Buy apples"
saved to 📄/home/markus/Memos.csv
.LINK
https://github.com/fleschutz/PowerShell

View File

@ -6,7 +6,7 @@
.PARAMETER message
Specifies the alert message
.EXAMPLE
PS> ./alert "Harddisk failure"
PS> ./alert.ps1 "Harddisk failure"
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -6,7 +6,7 @@
.PARAMETER RepoDir
Specifies the path to the Git repository
.EXAMPLE
PS> ./build-repo C:\MyRepo
PS> ./build-repo.ps1 C:\MyRepo
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -6,7 +6,7 @@
.PARAMETER ParentDir
Specifies the path to the parent folder
.EXAMPLE
PS> ./build-repos C:\MyRepos
PS> ./build-repos.ps1 C:\MyRepos
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -37,4 +37,4 @@ try {
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}
}

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script changes the working directory to the user's autostart folder.
.EXAMPLE
PS> ./cd-autostart
PS> ./cd-autostart.ps1
📂C:\Users\Markus\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
.LINK
https://github.com/fleschutz/PowerShell

View File

@ -5,7 +5,7 @@
This PowerShell script changes the working directory to the user's Dropbox folder.
.EXAMPLE
PS> ./cd-dropbox
📂/home/Markus/Dropbox
📂C:\Users\Markus\Dropbox
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -5,7 +5,7 @@
This PowerShell script changes the working directory to the user's home directory.
.EXAMPLE
PS> ./cd-home
📂/home/Markus
📂C:\Users\Markus
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -5,7 +5,7 @@
This PowerShell script changes the working directory to the user's music folder.
.EXAMPLE
PS> ./cd-music
📂/home/Markus/Music
📂C:\Users\Markus\Music
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -5,7 +5,7 @@
This PowerShell script changes the working directory to the user's OneDrive folder.
.EXAMPLE
PS> ./cd-onedrive
📂/home/Markus/OneDrive
📂C:\Users\Markus\OneDrive
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -5,7 +5,7 @@
This PowerShell script changes the working directory to the user's pictures folder.
.EXAMPLE
PS> ./cd-pics
📂/home/Markus/Pictures
📂C:\Users\Markus\Pictures
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -18,9 +18,7 @@ try {
} else {
$Path = [Environment]::GetFolderPath('MyPictures')
}
if (-not(Test-Path "$Path" -pathType container)) {
throw "Pictures folder at 📂$Path doesn't exist (yet)"
}
if (-not(Test-Path "$Path" -pathType container)) { throw "Pictures folder at 📂$Path doesn't exist (yet)" }
Set-Location "$Path"
"📂$Path"
exit 0 # success

View File

@ -18,12 +18,10 @@ try {
} else {
$Path = Resolve-Path "~/../Public"
}
if (Test-Path "$Path" -pathType container) {
Set-Location "$Path"
"📂$Path"
exit 0 # success
}
throw "Public folder at 📂$Path doesn't exist (yet)"
if (-not(Test-Path "$Path" -pathType container)) { throw "Public folder at 📂$Path doesn't exist (yet)" }
Set-Location "$Path"
"📂$Path"
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1

View File

@ -24,9 +24,7 @@ try {
} else {
$Path = "C:\$Recycle.Bin\" + "$(GetCurrentUserSID)"
}
if (-not(Test-Path "$Path" -pathType container)) {
throw "Recycle bin folder at 📂$Path doesn't exist (yet)"
}
if (-not(Test-Path "$Path" -pathType container)) { throw "Recycle bin folder at 📂$Path doesn't exist (yet)" }
Set-Location "$Path"
"📂$Path"
exit 0 # success

View File

@ -7,7 +7,7 @@
Specifies an additional relative subpath (optional)
.EXAMPLE
PS> ./cd-repos
📂C:\Users\Markus\Repos
📂C:\Users\Markus\source\Repos
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -26,9 +26,7 @@ try {
} else {
throw "The folder for Git repositories in your home directory doesn't exist (yet)."
}
if (-not(Test-Path "$Path" -pathType Container)) {
throw "The path to 📂$Path doesn't exist (yet)."
}
if (-not(Test-Path "$Path" -pathType Container)) { throw "The path to 📂$Path doesn't exist (yet)." }
$Path = Resolve-Path "$Path"
Set-Location "$Path"
"📂$Path"
@ -36,4 +34,4 @@ try {
} catch {
"⚠️ Error: $($Error[0])"
exit 1
}
}

View File

@ -5,7 +5,7 @@
This PowerShell script changes the working directory to the PowerShell scripts folder.
.EXAMPLE
PS> ./cd-scripts
📂/home/Markus/PowerShell/Scripts
📂C:\Users\Markus\source\repos\PowerShell\Scripts
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -14,9 +14,7 @@
try {
$Path = Resolve-Path "$PSScriptRoot"
if (-not(Test-Path "$Path" -pathType container)) {
throw "PowerShell scripts folder at 📂$Path doesn't exist (yet)"
}
if (-not(Test-Path "$Path" -pathType container)) { throw "PowerShell scripts folder at 📂$Path doesn't exist (yet)" }
Set-Location "$Path"
"📂$Path"
exit 0 # success

View File

@ -5,7 +5,7 @@
This PowerShell script changes the working directory to the user's SSH folder.
.EXAMPLE
PS> ./cd-ssh
📂/home/Markus/.ssh
📂C:\Users\Markus\.ssh
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -14,13 +14,11 @@
try {
$Path = Resolve-Path "~/.ssh"
if (Test-Path "$Path" -pathType container) {
Set-Location "$Path"
"📂$Path"
exit 0 # success
}
throw "User's SSH folder at 📂$Path doesn't exist (yet)"
if (-not(Test-Path "$Path" -pathType container)) { throw "User's SSH folder at 📂$Path doesn't exist (yet)" }
Set-Location "$Path"
"📂$Path"
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}
}

View File

@ -21,9 +21,7 @@ function GetTempDir {
try {
$Path = GetTempDir
if (-not(Test-Path "$Path" -pathType container)) {
throw "Temporary folder at 📂$Path doesn't exist (yet)"
}
if (-not(Test-Path "$Path" -pathType container)) { throw "Temporary folder at 📂$Path doesn't exist (yet)" }
Set-Location "$Path"
"📂$Path"
exit 0 # success

View File

@ -18,13 +18,11 @@ try {
} else {
$Path = [Environment]::GetFolderPath('Templates')
}
if (Test-Path "$Path" -pathType container) {
Set-Location "$Path"
"📂$Path"
exit 0 # success
}
throw "Templates folder at 📂$Path doesn't exist (yet)"
if (-not(Test-Path "$Path" -pathType container)) { throw "Templates folder at 📂$Path doesn't exist (yet)" }
Set-Location "$Path"
"📂$Path"
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}
}

View File

@ -24,9 +24,7 @@ try {
} else {
$Path = "C:\$Recycle.Bin\" + "$(GetCurrentUserSID)"
}
if (-not(Test-Path "$Path" -pathType container)) {
throw "Trash folder at 📂$Path doesn't exist (yet)"
}
if (-not(Test-Path "$Path" -pathType container)) { throw "Trash folder at 📂$Path doesn't exist (yet)" }
Set-Location "$Path"
"📂$Path"
exit 0 # success

View File

@ -14,9 +14,7 @@
try {
$Path = Resolve-Path ".."
if (-not(Test-Path "$Path" -pathType container)) {
throw "Folder at 📂$Path doesn't exist (yet)"
}
if (-not(Test-Path "$Path" -pathType container)) { throw "Folder at 📂$Path doesn't exist (yet)" }
Set-Location "$Path"
"📂$Path"
exit 0 # success

View File

@ -14,9 +14,7 @@
try {
$Path = Resolve-Path "../.."
if (-not(Test-Path "$Path" -pathType container)) {
throw "Folder at 📂$Path doesn't exist (yet)"
}
if (-not(Test-Path "$Path" -pathType container)) { throw "Folder at 📂$Path doesn't exist (yet)" }
Set-Location "$Path"
"📂$Path"
exit 0 # success

View File

@ -14,9 +14,7 @@
try {
$Path = Resolve-Path "../../.."
if (-not(Test-Path "$Path" -pathType container)) {
throw "Folder at 📂$Path doesn't exist (yet)"
}
if (-not(Test-Path "$Path" -pathType container)) { throw "Folder at 📂$Path doesn't exist (yet)" }
Set-Location "$Path"
"📂$Path"
exit 0 # success

View File

@ -14,9 +14,7 @@
try {
$Path = Resolve-Path "../../../.."
if (-not(Test-Path "$Path" -pathType container)) {
throw "Folder at 📂$Path doesn't exist (yet)"
}
if (-not(Test-Path "$Path" -pathType container)) { throw "Folder at 📂$Path doesn't exist (yet)" }
Set-Location "$Path"
"📂$Path"
exit 0 # success

View File

@ -14,13 +14,11 @@
try {
$Path = Resolve-Path "$HOME/.."
if (-not(Test-Path "$Path" -pathType container)) {
throw "Users directory at 📂$Path doesn't exist (yet)"
}
if (-not(Test-Path "$Path" -pathType container)) { throw "Users directory at 📂$Path doesn't exist (yet)" }
Set-Location "$Path"
"📂$Path"
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}
}

View File

@ -18,9 +18,7 @@ try {
} else {
$Path = [Environment]::GetFolderPath('MyVideos')
}
if (-not(Test-Path "$Path" -pathType container)) {
throw "Videos folder at 📂$Path doesn't exist (yet)"
}
if (-not(Test-Path "$Path" -pathType container)) { throw "Videos folder at 📂$Path doesn't exist (yet)" }
Set-Location "$Path"
"📂$Path"
exit 0 # success

View File

@ -14,9 +14,7 @@
try {
$Path = Resolve-Path "$env:WINDIR"
if (-not(Test-Path "$Path" -pathType container)) {
throw "Windows directory at 📂$Path doesn't exist"
}
if (-not(Test-Path "$Path" -pathType container)) { throw "Windows directory at 📂$Path doesn't exist" }
Set-Location "$Path"
"📂$Path"
exit 0 # success

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script queries the application status and prints it.
.EXAMPLE
PS> ./check-apps
PS> ./check-apps.ps1
119 apps installed, 11 upgrades available
.LINK
https://github.com/fleschutz/PowerShell

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script queries the status of the system battery and prints it.
.EXAMPLE
PS> ./check-battery
PS> ./check-battery.ps1
Battery 9% low, 54 min remaining
.LINK
https://github.com/fleschutz/PowerShell
@ -49,4 +49,4 @@ try {
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}
}

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script queries the BIOS status and prints it.
.EXAMPLE
PS> ./check-bios
PS> ./check-bios.ps1
BIOS model F6 version ALASKA - 1072009 by American Megatrends Inc.
.LINK
https://github.com/fleschutz/PowerShell
@ -39,4 +39,4 @@ try {
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}
}

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script queries the CPU status and prints it (name, type, speed, temperature, etc).
.EXAMPLE
PS> ./check-cpu
PS> ./check-cpu.ps1
AMD Ryzen 5 5500U with Radeon Graphics (CPU0, 2100MHz, 31.3°C)
.LINK
https://github.com/fleschutz/PowerShell

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script measures and prints the DNS resolution speed by using 200 popular domains.
.EXAMPLE
PS> ./check-dns
PS> ./check-dns.ps1
DNS resolves 156.5 domains per second
.LINK
https://github.com/fleschutz/PowerShell

View File

@ -4,7 +4,8 @@
.DESCRIPTION
This PowerShell script queries the time of dusk and answers by text-to-speech (TTS).
.EXAMPLE
PS> ./check-dusk
PS> ./check-dusk.ps1
Dusk is in 2 hours at 8 PM.
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -35,7 +36,7 @@ try {
$TimeSpan = TimeSpanToString($Now - $Dusk)
$Reply = "Dusk was $TimeSpan ago at $($Dusk.ToShortTimeString())."
}
& "$PSScriptRoot/speak-english.ps1" "$Reply"
Write-Output $Reply
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script queries the status of the firewall and prints it.
.EXAMPLE
PS> ./check-firewall
PS> ./check-firewall.ps1
Firewall enabled
.LINK
https://github.com/fleschutz/PowerShell

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script queries the GPU status and prints it.
.EXAMPLE
PS> ./check-gpu
PS> ./check-gpu.ps1
NVIDIA Quadro P400 GPU (2GB RAM, 3840x2160 pixels, 32 bit, 59 Hz, driver 31.0.15.1740, status OK)
.LINK
https://github.com/fleschutz/PowerShell
@ -43,4 +43,4 @@ try {
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}
}

View File

@ -23,4 +23,4 @@
& "$PSScriptRoot/check-smart-devices.ps1"
& "$PSScriptRoot/check-drives.ps1"
& "$PSScriptRoot/check-battery.ps1"
exit 0 # success
exit 0 # success

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script checks the time until Indepence Day and replies by text-to-speech (TTS).
.EXAMPLE
PS> ./check-independence-day
PS> ./check-independence-day.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script queries the operating system status and prints it.
.EXAMPLE
PS> ./check-os
PS> ./check-os.ps1
Windows 10 Pro 64-bit (v10.0.19045, since 6/22/2021, S/N 00123-45678-15135-AAOEM, P/K AB123-CD456-EF789-GH000-WFR6P)
.LINK
https://github.com/fleschutz/PowerShell
@ -36,4 +36,4 @@ try {
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}
}

View File

@ -4,7 +4,8 @@
.DESCRIPTION
This PowerShell script checks the inbox of Outlook for new/unread mails.
.EXAMPLE
PS> ./check-outlook
PS> ./check-outlook.ps1
No new mails.
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -27,4 +28,4 @@ try {
} catch {
"Sorry: $($Error[0])"
exit 1
}
}

View File

@ -5,7 +5,7 @@
This PowerShell script checks the security status of the given password by haveibeenpwned.com
.EXAMPLE
PS> ./check-password qwerty
Bad password, it's already listed in 10584568 known security breaches!
Bad password, it's already listed in 10584568 known security breaches!
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -41,7 +41,7 @@ try {
if ($password -eq "") { $password = Read-Host "Enter the password" }
$NumBreaches = Get-PasswordPwnCount $password
if ($NumBreaches -eq 0) {
"👍 Password seems good, it's not listed in any known security breach (as of today)"
"👍 Password seems good, it's not listed in any known security breach as of today."
} else {
"⚠️ Bad password, it's listed already in $NumBreaches known security breaches!"
}
@ -49,4 +49,4 @@ try {
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}
}

View File

@ -5,6 +5,7 @@
This PowerShell script queries pending operating system reboots and prints it.
.EXAMPLE
./check-pending-reboot.ps1
No pending reboot
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -6,7 +6,7 @@
.PARAMETER hosts
Specifies the hosts to check, seperated by commata (default is: amazon.com,bing.com,cnn.com,dropbox.com,facebook.com,github.com,google.com,live.com,twitter.com,youtube.com)
.EXAMPLE
PS> ./check-ping
PS> ./check-ping.ps1
Ping latency is 29ms average (13ms...109ms, 0 loss)
.LINK
https://github.com/fleschutz/PowerShell

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script queries the PowerShell status and prints it.
.EXAMPLE
PS> ./check-powershell
PS> ./check-powershell.ps1
PowerShell Desktop edition 5.1.19041.2673 (10 modules, 1458 cmdlets, 172 aliases)
.LINK
https://github.com/fleschutz/PowerShell

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script queries the status of the installed RAM and prints it.
.EXAMPLE
PS> ./check-ram
PS> ./check-ram.ps1
16GB DDR4 RAM @ 3200MHz (1.2V) in P0 CHANNEL A/DIMM 0 by Samsung
.LINK
https://github.com/fleschutz/PowerShell
@ -76,4 +76,4 @@ try {
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}
}

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script queries the status of the SSD/HDD devices (supporting S.M.A.R.T.) and prints it.
.EXAMPLE
PS> ./check-smart-devices
PS> ./check-smart-devices.ps1
1TB Samsung SSD 970 EVO via NVMe (2388 hours, 289x on, v2B2QEXE7, 37°C, selftest passed)
.LINK
https://github.com/fleschutz/PowerShell

View File

@ -6,7 +6,7 @@
.PARAMETER address
Specifies the subnet mask to check
.EXAMPLE
PS> ./check-subnet-mask 255.255.255.0
PS> ./check-subnet-mask.ps1 255.255.255.0
subnet mask 255.255.255.0 is valid
.LINK
https://github.com/fleschutz/PowerShell

View File

@ -8,6 +8,8 @@
Specifies the path to the folder
.EXAMPLE
PS> ./check-symlinks C:\Users
Checking symlinks at 📂C:\Users including subfolders...
Found 0 broken symlinks at 📂C:\Users in 60 sec
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -40,14 +42,14 @@ try {
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
if ($NumTotal -eq 0) {
"✔️ found no symlink at 📂$FullPath in $Elapsed sec."
"✔️ No symlink found at 📂$FullPath in $Elapsed sec"
} elseif ($NumBroken -eq 1) {
"✔️ found $NumBroken broken symlink at 📂$FullPath in $Elapsed sec."
"✔️ Found $NumBroken broken symlink at 📂$FullPath in $Elapsed sec"
} else {
"✔️ found $NumBroken broken symlinks at 📂$FullPath in $Elapsed sec."
"✔️ Found $NumBroken broken symlinks at 📂$FullPath in $Elapsed sec"
}
exit $NumBroken
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}
}

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script queries the time zone and prints it.
.EXAMPLE
PS> ./check-time-zone
PS> ./check-time-zone.ps1
11:13 AM W. Europe Summer Time (UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna (+01:00 DST)
.LINK
https://github.com/fleschutz/PowerShell

View File

@ -4,7 +4,8 @@
.DESCRIPTION
This PowerShell script queries the computer's uptime and prints it.
.EXAMPLE
PS> ./check-uptime
PS> ./check-uptime.ps1
Up for 2 days, 20 hours, 10 minutes
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -44,4 +45,4 @@ try {
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}
}

View File

@ -6,7 +6,7 @@
.PARAMETER location
Specifies the location to use (determined automatically per default)
.EXAMPLE
PS> ./check-weather
PS> ./check-weather.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script determines and speaks the current week number by text-to-speech (TTS).
.EXAMPLE
PS> ./check-week
PS> ./check-week.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -6,7 +6,7 @@
.PARAMETER location
Specifies the location to use (determined automatically per default)
.EXAMPLE
PS> ./check-wind
PS> ./check-wind.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script checks the validity of the Windows system files. It requires admin rights.
.EXAMPLE
PS> ./check-windows-system-files
PS> ./check-windows-system-files.ps1
checked Windows system files
.LINK
https://github.com/fleschutz/PowerShell

View File

@ -7,7 +7,12 @@
.PARAMETER RepoDir
Specifies the file path to the local Git repository
.EXAMPLE
PS> ./clean-repo C:\MyRepo
PS> ./clean-repo C:\base256unicode
(1/4) Searching for Git executable... git version 2.41.0.windows.3
(2/4) Checking local repository... 📂C:\base256unicode
(3/4) Removing untracked files in repository...
(4/4) Removing untracked files in submodules...
Cleaning the 📂base256unicode repo took 1 sec
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -4,7 +4,8 @@
.DESCRIPTION
This PowerShell script clears the DNS client cache of the local computer.
.EXAMPLE
PS> ./clear-dns-cache
PS> ./clear-dns-cache.ps1
cleared DNS cache in 0 ms
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -17,7 +18,7 @@ try {
Clear-DnsClientCache
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
"✔️ cleared DNS cache in $Elapsed ms."
"✔️ cleared DNS cache in $Elapsed sec"
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script closes the Git Extensions application gracefully.
.EXAMPLE
PS> ./close-git-extensions
PS> ./close-git-extensions.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script closes the Windows Screen Magnifier application gracefully.
.EXAMPLE
PS> ./close-magnifier
PS> ./close-magnifier.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script closes the Microsoft Paint application gracefully.
.EXAMPLE
PS> ./close-microsoft-paint
PS> ./close-microsoft-paint.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script closes the Microsoft Store application gracefully.
.EXAMPLE
PS> ./close-microsoft-store
PS> ./close-microsoft-store.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script closes the Netflix application gracefully.
.EXAMPLE
PS> ./close-netflix
PS> ./close-netflix.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script closes the Notepad application gracefully.
.EXAMPLE
PS> ./close-note-pad
PS> ./close-note-pad.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script closes the OBS Studio application gracefully.
.EXAMPLE
PS> ./close-obs-studio
PS> ./close-obs-studio.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script closes the OneCalendar application gracefully.
.EXAMPLE
PS> ./close-one-calendar
PS> ./close-one-calendar.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script closes the Microsoft Outlook email application gracefully.
.EXAMPLE
PS> ./close-outlook
PS> ./close-outlook.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script closes the Paint 3D application gracefully.
.EXAMPLE
PS> ./close-paint-3d
PS> ./close-paint-3d.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script closes the Serenade.ai application gracefully.
.EXAMPLE
PS> ./close-serenade
PS> ./close-serenade.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script closes the Snipping Tool application gracefully.
.EXAMPLE
PS> ./close-snipping-tool
PS> ./close-snipping-tool.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script closes the Spotify application gracefully.
.EXAMPLE
PS> ./close-spotify
PS> ./close-spotify.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script closes the Task Manager application gracefully.
.EXAMPLE
PS> ./close-task-manager
PS> ./close-task-manager.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script closes the 3D-Viewer application gracefully.
.EXAMPLE
PS> ./close-three-d-viewer
PS> ./close-three-d-viewer.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script closes the Mozilla Thunderbird email application gracefully.
.EXAMPLE
PS> ./close-thunderbird
PS> ./close-thunderbird.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script closes the Microsoft Visual Studio application gracefully.
.EXAMPLE
PS> ./close-visual-studio
PS> ./close-visual-studio.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script closes the VLC media player application gracefully.
.EXAMPLE
PS> ./close-vlc
PS> ./close-vlc.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script closes the Windows Terminal application gracefully.
.EXAMPLE
PS> ./close-windows-terminal
PS> ./close-windows-terminal.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -10,7 +10,7 @@
.PARAMETER FavoriteEditor
Specifies the user's favorite text editor
.EXAMPLE
PS> ./configure-git
PS> ./configure-git.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script tries to connect to the VPN.
.EXAMPLE
PS> ./connect-vpn
PS> ./connect-vpn.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -4,13 +4,9 @@
.DESCRIPTION
This PowerShell script converts an image to ASCII art.
.EXAMPLE
Convert-ImageToAscii -InFile "C:\Folder\Image.jpg" -Width 32 -Height 32
.INPUTS
.OUTPUTS
PS> ./convert-image2ascii -InFile "C:\Folder\Image.jpg" -Width 32 -Height 32
.NOTES
Author: Fxbyy
.FUNCTIONALITY
Converts an image to ASCII art.
#>
function Convert-ImageToAscii {
@ -96,4 +92,4 @@
$res
}
}
}

View File

@ -6,7 +6,7 @@
.PARAMETER FilePattern
Specifies the file pattern to the Markdown file(s)
.EXAMPLE
PS> ./convert-md2html *.md
PS> ./convert-md2html.ps1 *.md
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -14,7 +14,7 @@
.PARAMETER query
Specifies the SQL query
.EXAMPLE
PS> ./convert-mysql2csv
PS> ./convert-mysql2csv.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -6,7 +6,7 @@
.PARAMETER Filepattern
Specifies the file pattern
.EXAMPLE
PS> ./convert-ps2bat *.ps1
PS> ./convert-ps2bat.ps1 *.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -6,7 +6,7 @@
.PARAMETER filename
Specifies the path to the PowerShell script
.EXAMPLE
PS> ./convert-ps2md myscript.ps1
PS> ./convert-ps2md.ps1 myscript.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -14,7 +14,7 @@
.PARAMETER query
Specifies the SQL query
.EXAMPLE
PS> ./convert-sql2csv
PS> ./convert-sql2csv.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -8,7 +8,7 @@
.PARAMETER WavFile
Specifies the path to the resulting WAV file
.EXAMPLE
PS> ./convert-txt2wav "Hello World" spoken.wav
PS> ./convert-txt2wav.ps1 "Hello World" spoken.wav
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -8,7 +8,7 @@
.PARAMTER TargetDir
Specifies the path to the target folder
.EXAMPLE
PS> ./copy-photos-sorted D:\iPhone\DCIM C:\MyPhotos
PS> ./copy-photos-sorted.ps1 D:\iPhone\DCIM C:\MyPhotos
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -84,4 +84,4 @@ try {
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}
}

View File

@ -6,7 +6,7 @@
.PARAMETER Folder
Specifies the path to the folder
.EXAMPLE
PS> ./count-lines-of-code .
PS> ./count-lines-of-code.ps1 .
Counting lines at 📂C:\PowerShell\Scripts ...
📂Scripts contains 15287 lines of code in 485 files (took 1 sec)
.LINK
@ -38,4 +38,4 @@ try {
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}
}

View File

@ -8,7 +8,7 @@
.PARAMETER Password
Specifies the password
.EXAMPLE
PS> ./decrypt-file-rules C:\MyFile.txt "123"
PS> ./decrypt-file.ps1 C:\MyFile.txt "123"
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -4,7 +4,8 @@
.DESCRIPTION
This PowerShell script disconnects the active VPN connection.
.EXAMPLE
PS> ./disconnect-vpn
PS> ./disconnect-vpn.ps1
Disconnected now.
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -25,4 +26,4 @@ try {
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}
}

View File

@ -6,7 +6,7 @@
.PARAMETER URL
Specifies the URL where to download from
.EXAMPLE
PS> ./download-dir https://www.cnn.com
PS> ./download-dir.ps1 https://www.cnn.com
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -16,7 +16,7 @@
param([string]$URL = "")
try {
if ($URL -eq "") { $URL = read-host "Enter directory URL to download" }
if ($URL -eq "") { $URL = Read-Host "Enter directory URL to download" }
$StopWatch = [system.diagnostics.stopwatch]::startNew()

View File

@ -6,7 +6,7 @@
.PARAMETER URL
Specifies the URL where to download from
.EXAMPLE
PS> ./download-file https://www.cnn.com/index.html
PS> ./download-file.ps1 https://www.cnn.com/index.html
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -6,7 +6,7 @@
.PARAMETER Filename
Specifies the path to the filename
.EXAMPLE
PS> ./edit C:\MyFile.txt
PS> ./edit.ps1 C:\MyFile.txt
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -23,7 +23,6 @@ try {
& notepad.exe "$Filename"
if ($lastExitCode -ne "0") { throw "Can't execute 'notepad.exe' - make sure notepad.exe is installed and available" }
}
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script enables the writing of crash dumps.
.EXAMPLE
PS> ./enable-crash-dumps
PS> ./enable-crash-dumps.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -2,9 +2,10 @@
.SYNOPSIS
Enables the god mode
.DESCRIPTION
This PowerShell script enables the god mode. It adds a new icon to the desktop.
This PowerShell script enables the god mode in Windows. It adds a new icon to the desktop.
.EXAMPLE
PS> ./enable-god-mode
PS> ./enable-god-mode.ps1
God mode enabled, please click the new desktop icon
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -17,9 +18,8 @@ try {
Name = "GodMode.{ED7BA470-8E54-465E-825C-99712043E01C}"
ItemType = 'Directory'
}
$null = new-item @GodModeSplat
"✔️ enabled god mode - see the new desktop icon"
$null = New-Item @GodModeSplat
"✔️ God mode enabled, please click the new desktop icon"
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -8,7 +8,7 @@
.PARAMETER Password
Specifies the password to use
.EXAMPLE
PS> ./encrypt-file C:\MyFile.txt "123"
PS> ./encrypt-file.ps1 C:\MyFile.txt "123"
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script enters a chat using a common network shared file.
.EXAMPLE
PS> ./enter-chat
PS> ./enter-chat.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -7,7 +7,7 @@
PS> ./export-to-manuals.ps1
(1/2) Reading PowerShell scripts from /home/mf/PowerShell/Scripts/*.ps1 ...
(2/2) Exporting Markdown manuals to /home/mf/PowerShell/Scripts/../Docs ...
exported 518 Markdown manuals in 28 sec
Exporting 518 Markdown manuals took 28 sec
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -30,7 +30,7 @@ try {
}
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
"✔️ exported $($Scripts.Count) Markdown manuals in $Elapsed sec"
"✔️ Exporting $($Scripts.Count) Markdown manuals took $Elapsed sec"
exit 0 # success
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -6,7 +6,11 @@
.PARAMETER RepoDir
Specifies the file path to the local Git repository (default is working directory).
.EXAMPLE
PS> ./fetch-repo C:\MyRepo
PS> ./fetch-repo.ps1 C:\MyRepo
(1/3) Searching for Git executable... git version 2.41.0.windows.3
(2/3) Checking local repository... 📂C:\MyRepo
(3/3) Fetching updates...
Fetching updates into repository 📂MyRepo took 2 sec
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -6,7 +6,7 @@
.PARAMETER ParentDir
Specifies the path to the parent folder
.EXAMPLE
PS> ./fetch-repos C:\MyRepos
PS> ./fetch-repos.ps1 C:\MyRepos
(1) Searching for Git executable... git version 2.41.0.windows.3
(2) Checking parent folder... 33 subfolders
(3/35) Fetching into 📂base256unicode...

View File

@ -7,6 +7,7 @@
Specifies the path to the file
.EXAMPLE
PS> ./get-md5 C:\MyFile.txt
MD5 hash is 041E16F16E60AD250EB794AF0681BD4A
.LINK
https://github.com/fleschutz/PowerShell
.NOTES

View File

@ -7,6 +7,7 @@
Specifies the path to the file
.EXAMPLE
PS> ./get-sha1 C:\MyFile.txt
SHA1 hash is 8105D424D350E308AED92BD9DDEB74A1B53C5D7C
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -16,7 +17,7 @@
param([string]$file = "")
try {
if ($file -eq "" ) { $file = read-host "Enter the filename" }
if ($file -eq "" ) { $file = Read-Host "Enter the filename" }
$Result = get-filehash $file -algorithm SHA1

View File

@ -7,6 +7,7 @@
Specifies the path to the file
.EXAMPLE
PS> ./get-sha256 C:\MyFile.txt
SHA256 hash is: CEB4AD71524996EB8AA3ADCE04F1E45636A4B58B8BF4462E6971CF2E56B4293E
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -16,7 +17,7 @@
param([string]$file = "")
try {
if ($file -eq "" ) { $file = read-host "Enter the filename" }
if ($file -eq "" ) { $file = Read-Host "Enter the filename" }
$Result = get-filehash $file -algorithm SHA256

View File

@ -4,7 +4,7 @@
.DESCRIPTION
This PowerShell script installs Audacity.
.EXAMPLE
PS> ./install-audacity
PS> ./install-audacity.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
@ -22,4 +22,4 @@ try {
} catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}
}

Some files were not shown because too many files have changed in this diff Show More