Private/Scripts/TipOfTheDay.ps1
# ? TITEL Tip of the day # ? DESCRIPTION Beim laden des Modules AKPT wird immer ein Tipp angezeigt. # ? TAGS TOTD # ? VERSION 2020.01.15 #region Prolog using namespace System.Management.Automation $ErrorActionPreference = [ActionPreference]::Stop Set-StrictMode -Version Latest #endregion class TipOfTheDay { [int]$Id [string]$Tip [String]$Resource } $totdDb = @() $totdDb += [TipOfTheDay]@{Id = 1 ; Tip="Auf dem laufenden bleiben, z.B. über meinen RSS-Feed." ; Resource="https://www.attilakrick.com/rss/blog/"} $totdDb += [TipOfTheDay]@{Id = 2 ; Tip="Auf dem laufenden bleiben. Folgenden Sie mir auf Twitter." ; Resource="https://twitter.com/AttilaKrick"} $totdDb += [TipOfTheDay]@{Id = 3 ; Tip="Auf dem laufenden bleiben. Verbinden Sie isch mit mir auf LinkedIn." ; Resource="https://www.linkedin.com/in/attilakrick/"} $totdDb += [TipOfTheDay]@{Id = 4 ; Tip="Artikel: Für Objekte ein PropertyGrid-Fenster anzeigen lassen." ; Resource="https://www.attilakrick.com/blog-pspropertygrid"} $totdDb += [TipOfTheDay]@{Id = 5 ; Tip="Artikel: PowerShell-Objekte-Doku einfach aufrufen" ; Resource="https://www.attilakrick.com/blog-psobjektdoku"} $totdDb += [TipOfTheDay]@{Id = 6 ; Tip="Artikel: Wie kann ich ein mir unbekanntes Cmdlet finden?" ; Resource="https://www.attilakrick.com/blog-pscmdletfinding"} $totdDb += [TipOfTheDay]@{Id = 7 ; Tip="Artikel: PowerShell-Objekte in 3 Schritten erfolgreich analysieren" ; Resource="https://www.attilakrick.com/blog-psobjektanalyse/"} $totdDb += [TipOfTheDay]@{Id = 8 ; Tip="Artikel: Was Hacker mit der PowerShell erreichen können" ; Resource="https://www.attilakrick.com/blog-pshacking/"} $totdDb += [TipOfTheDay]@{Id = 9 ; Tip="Artikel: PowerShell Hintergrundwissen" ; Resource="https://www.attilakrick.com/blog-pshintergrundwissen/"} $totdDb += [TipOfTheDay]@{Id = 10 ; Tip="Artikel: PowerShell-Objekte für die eigenen Zwecke erweitern und einspannen." ; Resource="https://www.attilakrick.com/blog-pstypeextension/"} $totdDb += [TipOfTheDay]@{Id = 11 ; Tip="Artikel: Der ideale Aufbau einer PowerShell-Script-Datei (.PS1, .PSM1)" ; Resource="https://www.attilakrick.com/blog-psoptps1file/"} $totdDb += [TipOfTheDay]@{Id = 12 ; Tip="Artikel: PowerShell 7 Neuerungen und Gründe für den Umstieg" ; Resource="https://www.attilakrick.com/blog-ps7/"} $totdDb += [TipOfTheDay]@{Id = 13 ; Tip="Cmdlet: Find-Know => Um in der AKPT-Wissensdatenbank zu suchen." ; Resource="Find-Know -Keyword Pester"} $totdDb += [TipOfTheDay]@{Id = 14 ; Tip="Cmdlet: Get-Hotkeys => Zeigt die wichtigsten Tastatur-Befehle rund um PowerShell an." ; Resource="Get-Hotkeys"} $nowTotd = $totdDb | Get-Random -Count 1 $esc=$([char]27) @" $esc[90m- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -$esc[0m Tipp des Tages - Nummer: $esc[91m$($nowTotd.Id)$esc[0m $esc[36m$($nowTotd.Tip)$esc[0m Ressource: $esc[91m$($nowTotd.Resource)$esc[0m $esc[90m- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -$esc[0m "@ | Out-Host |