$ErrorActionPreference = 'Stop'

$item = Get-ChildItem -File -Filter '*.xlsx' | Where-Object { $_.Name -like '*Sheet*.xlsx' } | Sort-Object LastWriteTime -Descending | Select-Object -First 1
if (-not $item) {
    throw 'Workbook not found.'
}

$excel = New-Object -ComObject Excel.Application
$excel.Visible = $false
$excel.DisplayAlerts = $false
try {
    $wb = $excel.Workbooks.Open($item.FullName)
    $ws = $wb.Worksheets.Item(1)
    for ($r = 2; $r -le $ws.UsedRange.Rows.Count; $r++) {
        Write-Output (($r.ToString()) + '|' + $ws.Cells.Item($r, 1).Text + '|' + $ws.Cells.Item($r, 4).Text + '|' + $ws.Cells.Item($r, 5).Text)
    }
    $wb.Close($false)
}
finally {
    $excel.Quit()
}
