Merge branch 'main' of github.com:fleschutz/PowerShell

This commit is contained in:
Markus Fleschutz 2024-10-23 16:57:44 +02:00
commit 01a00dd30f

View File

@ -11,32 +11,35 @@
Author: Markus Fleschutz | License: CC0 Author: Markus Fleschutz | License: CC0
#> #>
function Line ([string]$line) { function White([string]$line) {
Write-Host $line -foregroundColor white -backgroundColor black Write-Host $line -foregroundColor white -backgroundColor black -noNewline
}
function Blue([string]$line) {
Write-Host $line -foregroundColor blue -backgroundColor black -noNewline
} }
try { try {
Line "█████████████████████████████████████" White "█████████████████████████████████████`n"
Line "█████████████████████████████████████" White "█████████████████████████████████████`n"
Line "████ ▄▄▄▄▄ █▀ █▀▀█▀▀ ▄▄██ ▄▄▄▄▄ ████ You are using POWERSHELL $($PSVersionTable.PSVersion) $($PSVersionTable.PSEdition) edition." White "████ ▄▄▄▄▄ █▀ █▀▀█▀▀ ▄▄██ ▄▄▄▄▄ ████ You are using POWERSHELL $($PSVersionTable.PSVersion) $($PSVersionTable.PSEdition) edition.`n"
Line "████ █ █ █▀ ▄ █▀ ▀ ▀▄█ █ █ █ ████" White "████ █ █ █▀ ▄ █▀ ▀ ▀▄█ █ █ █ ████`n"
Line "████ █▄▄▄█ █▀█ █▄▀▄▀ ▀ ▄▄█ █▄▄▄█ ████ Documentation: https://docs.microsoft.com/en-us/powershell" White "████ █▄▄▄█ █▀█ █▄▀▄▀ ▀ ▄▄█ █▄▄▄█ ████ Documentation: "; Blue "https://docs.microsoft.com/en-us/powershell`n"
Line "████▄▄▄▄▄▄▄█▄█▄█ █▄█ █▄▀ █▄▄▄▄▄▄▄████" White "████▄▄▄▄▄▄▄█▄█▄█ █▄█ █▄▀ █▄▄▄▄▄▄▄████`n"
Line "████▄▄ ▄█▄▄ ▄█▄▄ █▀ ▀▀▀ ▀▄▀▄█▄▀████ Tutorial: https://www.guru99.com/powershell-tutorial.html" White "████▄▄ ▄█▄▄ ▄█▄▄ █▀ ▀▀▀ ▀▄▀▄█▄▀████ Tutorial: "; Blue "https://www.guru99.com/powershell-tutorial.html`n"
Line "████▀▄▄█▀█▄██ ▀ ▄▄▀ █▄█▀ ▀ ▄▀▀█▀█████" White "████▀▄▄█▀█▄██ ▀ ▄▄▀ █▄█▀ ▀ ▄▀▀█▀█████`n"
Line "█████ ▄▄█▄▄▀▄ ▀▄▀ ▄▄ ▀ ▀▀▀ ▀▄▄█▀████ 500+ Sample Scripts: https://github.com/fleschutz/PowerShell" White "█████ ▄▄█▄▄▀▄ ▀▄▀ ▄▄ ▀ ▀▀▀ ▀▄▄█▀████ 500+ Sample Scripts: "; Blue "https://github.com/fleschutz/PowerShell`n"
Line "████▄ ▀ ▄ ▄▄█ █▀██▄ ██▀▄█▄▄▀▄▄▀█████" White "████▄ ▀ ▄ ▄▄█ █▀██▄ ██▀▄█▄▄▀▄▄▀█████`n"
Line "████ ████▄▄ ▄█▄▄▄██ ▀ ▀▀▀▀▄ █▀████ FAQ's: https://github.com/fleschutz/PowerShell/blob/main/docs/FAQ.md" White "████ ████▄▄ ▄█▄▄▄██ ▀ ▀▀▀▀▄ █▀████ FAQ's: "; Blue "https://github.com/fleschutz/PowerShell/blob/main/docs/FAQ.md`n"
Line "████ ███▄ ▄▀▀██ ▄█ ▄▄▄█▀ ▄▄ ██▄▀█████" White "████ ███▄ ▄▀▀██ ▄█ ▄▄▄█▀ ▄▄ ██▄▀█████`n"
Line "████▄█▄███▄▄▀▄▄▄▀ ▄▄ ▄▀▄ ▄▄▄ ▀ ████ Cheat Sheet: https://github.com/fleschutz/PowerShell/blob/main/docs/cheat-sheet.md" White "████▄█▄███▄▄▀▄▄▄▀ ▄▄ ▄▀▄ ▄▄▄ ▀ ████ Cheat Sheet: "; Blue "https://github.com/fleschutz/PowerShell/blob/main/docs/cheat-sheet.md`n"
Line "████ ▄▄▄▄▄ █▄▄▄█▀█▄ ██ █▄█ ▄▄█▀████" White "████ ▄▄▄▄▄ █▄▄▄█▀█▄ ██ █▄█ ▄▄█▀████`n"
Line "████ █ █ █ ▀▄█▄ ▄▄ ▀█ ▄▄▄▄▀ ████ Videos: https://www.youtube.com/results?search_query=PowerShell" White "████ █ █ █ ▀▄█▄ ▄▄ ▀█ ▄▄▄▄▀ ████ Videos: "; Blue "https://www.youtube.com/results?search_query=PowerShell`n"
Line "████ █▄▄▄█ █ ██ ▄█▄ ▄▀▀▀ ▄▄ ▄ █████" White "████ █▄▄▄█ █ ██ ▄█▄ ▄▀▀▀ ▄▄ ▄ █████`n"
Line "████▄▄▄▄▄▄▄█▄▄█▄▄████▄▄▄██▄▄▄█▄██████ HINT: Use <Ctrl> + <Click> to open the links in your browser." White "████▄▄▄▄▄▄▄█▄▄█▄▄████▄▄▄██▄▄▄█▄██████ HINT: Use <Ctrl> + <Click> to open the links in your browser.`n"
Line "█████████████████████████████████████" White "█████████████████████████████████████`n"
Line "█████████████████████████████████████" White "█████████████████████████████████████`n"
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptWhiteNumber): $($Error[0])"
exit 1 exit 1
} }