0

This command will give some properties of an ls item:

PS> (ls)[0]|select *

PSPath            : Microsoft.PowerShell.Core\F...
PSParentPath      : Microsoft.PowerShell.Core\F...
PSChildName       : myscript
PSDrive           : C
PSProvider        : Microsoft.PowerShell.Core\F...
PSIsContainer     : True
Mode              : d-----
BaseName          : myscript
Target            : {}
LinkType          :
Name              : myscript
FullName          : C:\ps\myscript
...

I want to count how many line the output have.

This post gives a solution based on Measure-Object to count a CSV, but it is not applied here. Is there any method to do this? As I count one by one,the last result should be 23.

Ansgar Wiechers
  • 184,186
  • 23
  • 230
  • 299
yode
  • 361
  • 4
  • 12

0 Answers0