Submitted By: Kent Finkle

Uses Windows PowerShell to count the number of files in a folder.

Visual Basic
Edit|Remove
#  Script name:    CountFiles.ps1
#  Created on:     2006-10-03
#  Author:         Kent Finkle
#  Purpose:        Count the files in a Directory with PowerShell.

$fileCount = [System.IO.Directory]::GetFiles("c:\scripts\").Length;
[Console]::WriteLine($fileCount);