Skip to content

Instantly share code, notes, and snippets.

@Windos
Created February 2, 2021 20:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Windos/0da44a5b0a9f4b04a117316a347d15c0 to your computer and use it in GitHub Desktop.
Save Windos/0da44a5b0a9f4b04a117316a347d15c0 to your computer and use it in GitHub Desktop.
RTPSUG Meetup Practice Challenge
# 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