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 .PARAMETER PathToExecutables
Specifies the path to the executables Specifies the path to the executables
.EXAMPLE .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\app1.exe
Adding firewall rule for C:\MyApp\bin\app2.exe Adding firewall rule for C:\MyApp\bin\app2.exe
... ...

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -4,7 +4,7 @@
.DESCRIPTION .DESCRIPTION
This PowerShell script queries the operating system status and prints it. This PowerShell script queries the operating system status and prints it.
.EXAMPLE .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) 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 .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
@ -36,4 +36,4 @@ try {
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1 exit 1
} }

View File

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

View File

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

View File

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

View File

@ -6,7 +6,7 @@
.PARAMETER hosts .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) 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 .EXAMPLE
PS> ./check-ping PS> ./check-ping.ps1
Ping latency is 29ms average (13ms...109ms, 0 loss) Ping latency is 29ms average (13ms...109ms, 0 loss)
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -7,7 +7,12 @@
.PARAMETER RepoDir .PARAMETER RepoDir
Specifies the file path to the local Git repository Specifies the file path to the local Git repository
.EXAMPLE .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 .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,7 +6,7 @@
.PARAMETER URL .PARAMETER URL
Specifies the URL where to download from Specifies the URL where to download from
.EXAMPLE .EXAMPLE
PS> ./download-dir https://www.cnn.com PS> ./download-dir.ps1 https://www.cnn.com
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -16,7 +16,7 @@
param([string]$URL = "") param([string]$URL = "")
try { 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() $StopWatch = [system.diagnostics.stopwatch]::startNew()

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -6,7 +6,11 @@
.PARAMETER RepoDir .PARAMETER RepoDir
Specifies the file path to the local Git repository (default is working directory). Specifies the file path to the local Git repository (default is working directory).
.EXAMPLE .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 .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES

View File

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

View File

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

View File

@ -7,6 +7,7 @@
Specifies the path to the file Specifies the path to the file
.EXAMPLE .EXAMPLE
PS> ./get-sha1 C:\MyFile.txt PS> ./get-sha1 C:\MyFile.txt
SHA1 hash is 8105D424D350E308AED92BD9DDEB74A1B53C5D7C
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -16,7 +17,7 @@
param([string]$file = "") param([string]$file = "")
try { 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 $Result = get-filehash $file -algorithm SHA1

View File

@ -7,6 +7,7 @@
Specifies the path to the file Specifies the path to the file
.EXAMPLE .EXAMPLE
PS> ./get-sha256 C:\MyFile.txt PS> ./get-sha256 C:\MyFile.txt
SHA256 hash is: CEB4AD71524996EB8AA3ADCE04F1E45636A4B58B8BF4462E6971CF2E56B4293E
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -16,7 +17,7 @@
param([string]$file = "") param([string]$file = "")
try { 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 $Result = get-filehash $file -algorithm SHA256

View File

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

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