I'm trying to write a very simple PowerShell script to give me the total number of items (both files and folders) in a given folder (c:MyFolder
). Here's what I've done:
Write-Host ( Get-ChildItem c:MyFolder ).Count;
The problem is, that if I have 1 or 0 items, the command does not work---it returns nothing.
Any ideas?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…