PowerShell/scripts/write-help.ps1

46 lines
3.4 KiB
PowerShell
Raw Normal View History

2024-10-01 15:24:16 +02:00
<#
2024-06-18 09:19:46 +02:00
.SYNOPSIS
2024-09-03 18:26:53 +02:00
Writes a help page
2024-06-18 09:19:46 +02:00
.DESCRIPTION
2024-09-17 13:29:22 +02:00
This PowerShell script writes a PowerShell help page.
2024-06-18 09:19:46 +02:00
.EXAMPLE
2024-09-03 18:26:53 +02:00
PS> ./write-help.ps1
2024-06-18 09:19:46 +02:00
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
Author: Markus Fleschutz | License: CC0
#>
2024-05-29 17:07:27 +02:00
2024-10-23 15:55:43 +02:00
function White([string]$line) {
Write-Host $line -foregroundColor white -backgroundColor black -noNewline
}
function Blue([string]$line) {
Write-Host $line -foregroundColor blue -backgroundColor black -noNewline
2024-09-03 18:06:07 +02:00
}
2024-05-29 17:07:27 +02:00
try {
2024-10-23 15:55:43 +02:00
White "█████████████████████████████████████`n"
2024-10-28 13:39:57 +01:00
White "█████████████████████████████████████ 👋 Welcome to POWERSHELL $($PSVersionTable.PSVersion) $($PSVersionTable.PSEdition) edition`n"
2024-10-24 17:36:48 +02:00
White "████ ▄▄▄▄▄ █▀ █▀▀█▀▀ ▄▄██ ▄▄▄▄▄ ████`n"
White "████ █ █ █▀ ▄ █▀ ▀ ▀▄█ █ █ █ ████ Documentation: "; Blue "https://docs.microsoft.com/en-us/powershell`n"
White "████ █▄▄▄█ █▀█ █▄▀▄▀ ▀ ▄▄█ █▄▄▄█ ████`n"
White "████▄▄▄▄▄▄▄█▄█▄█ █▄█ █▄▀ █▄▄▄▄▄▄▄████ Tutorial: "; Blue "https://www.guru99.com/powershell-tutorial.html`n"
White "████▄▄ ▄█▄▄ ▄█▄▄ █▀ ▀▀▀ ▀▄▀▄█▄▀████`n"
White "████▀▄▄█▀█▄██ ▀ ▄▄▀ █▄█▀ ▀ ▄▀▀█▀█████ Video tutorials: "; Blue "https://www.youtube.com/results?search_query=PowerShell`n"
White "█████ ▄▄█▄▄▀▄ ▀▄▀ ▄▄ ▀ ▀▀▀ ▀▄▄█▀████`n"
2024-11-22 11:40:07 +01:00
White "████▄ ▀ ▄ ▄▄█ █▀██▄ ██▀▄█▄▄▀▄▄▀█████ Type 'Get-Help <NAME>' to display information about <NAME>`n"
2024-10-24 17:36:48 +02:00
White "████ ████▄▄ ▄█▄▄▄██ ▀ ▀▀▀▀▄ █▀████`n"
White "████ ███▄ ▄▀▀██ ▄█ ▄▄▄█▀ ▄▄ ██▄▀█████ FAQ's: "; Blue "https://github.com/fleschutz/PowerShell/blob/main/docs/FAQ.md`n"
White "████▄█▄███▄▄▀▄▄▄▀ ▄▄ ▄▀▄ ▄▄▄ ▀ ████`n"
White "████ ▄▄▄▄▄ █▄▄▄█▀█▄ ██ █▄█ ▄▄█▀████ 500+ sample scripts: "; Blue "https://github.com/fleschutz/PowerShell`n"
White "████ █ █ █ ▀▄█▄ ▄▄ ▀█ ▄▄▄▄▀ ████`n"
White "████ █▄▄▄█ █ ██ ▄█▄ ▄▀▀▀ ▄▄ ▄ █████ Cheat sheet: "; Blue "https://github.com/fleschutz/PowerShell/blob/main/docs/cheat-sheet.md`n"
White "████▄▄▄▄▄▄▄█▄▄█▄▄████▄▄▄██▄▄▄█▄██████`n"
White "█████████████████████████████████████ NOTE: use <Ctrl> + <Click> to open the links in your browser.`n"
2024-10-23 15:55:43 +02:00
White "█████████████████████████████████████`n"
2024-09-03 18:18:09 +02:00
exit 0 # success
2024-05-29 17:07:27 +02:00
} catch {
2024-10-23 15:55:43 +02:00
"⚠️ Error in line $($_.InvocationInfo.ScriptWhiteNumber): $($Error[0])"
2024-09-03 18:18:09 +02:00
exit 1
2024-08-26 15:36:14 +02:00
}