To get the entire contents of a file:
$content = [IO.File]::ReadAllText(".\test.txt")
Number of lines:
([IO.File]::ReadAllLines(".\test.txt")).length
or
(gc .\test.ps1).length
Sort of hackish to include trailing empty line:
[io.file]::ReadAllText(".\desktop\git-python\test.ps1").split("`n").count