Powershell script to Get-Content of last line in multple files (loop array)
<p>I have a folder with a list of files (*.log files) which all end with the following line, showing the output (different files will have different amounts) e.g.:</p>

<pre><code>Total MB moved to Archive = 369.06444644928
</code></pre>

<p>I have the following query which will get the result of the first file in the folder:</p>

<pre><code>Get-ChildItem $path| Where-Object {$_.Name} | Get-Content | select -last 1
</code></pre>

<p>I also have the following query which will output a list of all the log files:</p>

<pre><code>Get-ChildItem $Path |  ForEach {
Write-Host $_.Name}
</code></pre>

<p>I just want to create a loop to print a list of each last line of each log, not the log name or the last line of one log. And then the complex part, to pull the number part and add these together. Any tips?</p>