$text = @"This is somesample textLet"s find outthe number of lines."@$text.Length - $text.Replace("`n","").Length + 1