Created
February 2, 2021 20:10
-
-
Save Windos/0da44a5b0a9f4b04a117316a347d15c0 to your computer and use it in GitHub Desktop.
RTPSUG Meetup Practice Challenge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See challenge prompt here: https://jdhitsolutions.com/blog/powershell/8107/scripting-challenge-meetup/ | |
$HelpAbout = help about_Splatting | |
$Words = $HelpAbout -replace '_', ' ' -split '\b' | Where-Object {$_ -match '\w+' -and $_ -ne 'the'} | |
$GroupedWords = $Words | Group-Object | Sort-Object -Property Count -Descending | |
[PSCustomObject] @{ | |
Name = $HelpAbout.Name | |
WordCount = $Words.Count | |
TopWord = $GroupedWords[0].Name | |
TopWordCount = $GroupedWords[0].Count | |
TopFiveWords = $GroupedWords[0..4].Name | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment