From ec667c18f5441ac88e6174737c2105816b575c32 Mon Sep 17 00:00:00 2001 From: norbert-walter Date: Fri, 6 Mar 2026 15:20:47 +0100 Subject: [PATCH] Fix for power shell script --- lib/obp60task/code_size.ps1 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/obp60task/code_size.ps1 b/lib/obp60task/code_size.ps1 index 0cf586b..3c1a0c7 100644 --- a/lib/obp60task/code_size.ps1 +++ b/lib/obp60task/code_size.ps1 @@ -1,12 +1,16 @@ -param([string]$dir = ".") +param( + [string]$dir = "." +) $total = 0 -Get-ChildItem $dir -Recurse -Include *.c, *.cpp, *.h -File | ForEach-Object { - $lines = [System.IO.File]::ReadLines($_.FullName).Count +Get-ChildItem -Path $dir -Recurse -File | Where-Object { + $_.Extension -in ".c", ".cpp", ".h" +} | ForEach-Object { + $lines = [System.Linq.Enumerable]::Count([System.IO.File]::ReadLines($_.FullName)) Write-Output "$($_.FullName) : $lines" $total += $lines } -Write-Output "-----------------------" +Write-Output "-----------------------------" Write-Output "Over all files: $total" \ No newline at end of file