Welcome to the Microsoft Script Center. We are dedicated to the system administrator scripters of the world. At the Microsoft Script Center, we focus on teaching people how to use Windows PowerShell to reduce time spent performing mundane tasks.
Â
What's new?
Check out the Hey, Scripting Guy! blog to catch all the latest news, events, and, of course, scripts!
PowerTip: Count Your PowerShell Scripts Summary: Learn how to count how many PowerShell scripts you have written.
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?
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
Wednesday, Jul 24