用PowerShell来计算代码的大小和行数
这里是两段脚本来计算代码的大小和行数。
代码大小(MB):
(Get-ChildItem . -Recurse | Where-Object {(!$_.PSIsContainer) -And ($_.FullName -Match '\.(h|m|cpp|c|cs|y)$')} | Measure-Object -Property Length -Sum).Sum / 1MB 
代码行数:
Get-ChildItem . -Recurse | Where-Object {(!$_.PSIsContainer) -And ($_.FullName –Match '\.(h|m|cpp|c|cs|y)$')} | ForEach-Object {$l = 0} {$l += (Get-Content $_.PSPath).Count} {$l} 
 
                    
                 
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号