PowerTip: Count Your PowerShell Scripts

PowerTip: Count Your PowerShell Scripts

  • Comments 3

Summary: Learn how to count how many PowerShell scripts you have written.

Hey, Scripting Guy! Question My boss asked me how many Windows PowerShell scripts I have written. I keep all my scripts in a specific folder. How can I use Windows PowerShell to count them?

Hey, Scripting Guy! Answer Use the Get-ChildItem cmdlet (dir is an alias), and specify the path, a filter, and the Recurse parameter; then pipe the results to the Measure-Object cmdlet:

dir -Path C:\data -Filter *.ps1 -Recurse | measure

Leave a Comment
  • Please add 7 and 5 and type the answer here:
  • Post
  • (gci H:\GitHub\vbScript -Filter *.vbs -Recurse).Count

  • So I have to ask Ed, how many do you have?

  • @Daniel Ratliff As of today (I wrote two scripts this morning) I have 6,061 PowerShell Scripts.

Page 1 of 1 (3 items)