Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • What version of PowerShell are you using? It matters, because Measure-Object in PowerShell 6 (PowerShell Core) supports a more extensive set of capabilities than previous versions did, including being able to specify multiple fields for calculations, and provision of a scriptblock for calculations. See Microsoft Docs on Measure-Object for PS6 Commented Apr 10, 2019 at 17:29
  • Also, you don't need to convert the file from being delimited with | to being delimited with ,; PowerShell's Import-CSV allows you to specify a -Delimiter parameter since PS4. Commented Apr 10, 2019 at 17:34
  • I'm using PowerShell v4 on Windows Server 2012
    – masterl
    Commented Apr 10, 2019 at 17:36