Created
February 1, 2021 15:50
-
-
Save thedavecarroll/3f85a4c5bb2d22f2ce7d44a7e2bddb48 to your computer and use it in GitHub Desktop.
Scripting Challenge Meetup
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
$Splatting = Get-Help about_Splatting | |
$SortByWordCount = $Splatting -Split('\W+') | Where-Object {$_ -ne 'the'} | Group-Object | Sort-Object -Property Count -Descending | |
$Splatting | Select-Object Name, | |
@{l='NumberOfWords';e={$_.ToString() | Measure-Object -Word | Select-Object -ExpandProperty Words}}, | |
@{l='TopWord';e={$SortByWordCount[0].Name}},@{l='TopWordCount';e={$SortByWordCount[0].Count}}, | |
@{l='Top5Words';e={($SortByWordCount.Name | Select-Object -First 5) -join ','}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output: