Powershell Reading text file word by word
<p>So I'm trying to count the words of my text file however when I do get-content the array reads them letter by letter and so it doesn't let me compare them word by word. I hope you guys can help me out!</p>

<p>Clear-Host
    #Functions</p>

<pre><code>function Get-Articles (){

 foreach($Word in $poem){
    if($Articles -contains $Word){
       $Counter++
    }
}
    write-host "The number of Articles in your sentence: $counter"
}

#Variables

$Counter = 0

$poem = $line
$Articles = "a","an","the"

#Logic

$fileExists = Test-Path "text.txt"

if($fileExists) {
    $poem = Get-Content "text.txt"
    }
else
    {
    Write-Output "The file SamMcGee does not exist"  
    exit(0) 
    }

$poem.Split(" ")

Get-Articles
</code></pre>