posts-powershell

Getting the Number of Lines in a String

All PowerShell Versions Here is a clever trick how to find out how many lines a string (not a string array!) contains: $text = @'...

  • Written By: ps1
  • Last Updated: April 18, 2025
  • 1 minute read