Last active
August 29, 2015 14:22
-
-
Save ngbrown/953502517ccabd5bd264 to your computer and use it in GitHub Desktop.
Determine lines of code
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
Function IIf($If, $IfTrue, $IfFalse) { | |
If ($If -IsNot "Boolean") {$_ = $If} | |
If ($If) {If ($IfTrue -is "ScriptBlock") {&$IfTrue} Else {$IfTrue}} | |
Else {If ($IfFalse -is "ScriptBlock") {&$IfFalse} Else {$IfFalse}} | |
} | |
Get-ChildItem -include *.js -exclude *.min.js -recurse | ?{$_.fullname -notmatch "\\node_modules\\?"} | |
Get-ChildItem -include *.js -recurse | select-string . | Group-Object Path -NoElement | ForEach-Object {IIf($_.Count -le 50) "a. <=50" {IIf($_.Count -le 100) "b. <=100" {IIf($_.Count -le 200) "c. <=200" {IIf($_.Count -le 500) "d. <=500" "e. >500"}}}} | Group-Object -NoElement | Sort-Object Name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment