I've got a text document and want to preform two things: 1) delete first 5 lines and 2) for each line of text, grab only the first 8 characters. To help me in my logic, I've got this broken down into steps, with each step creating a new file. My problem is with the last step of the script, $file3 is never created and I'm clueless.
cls$file1 = 'C:\cs1.txt'
$file2 = 'C:\cs2.txt'
$file3 = 'C:\cs3.txt'
$lines = @()
(Get-Content $file1 | Select-Object -Skip 5) | Set-Content $file2
Get-Content $file2 | ForEach-Object {$line=$_[5..8]} | Add-Content $file3