Using the values from a CSV file

  • Hi,

    I want to load a log so that I can see which bat file failed, and restart from that point.  I'm struggling a bit with this, can anyone point me in the right direction? So far I have got:

    $csv = Import-Csv E:\Backup\Schdule_log.csv

    $csv

    $Failed  = $csv.Batfile | Where-Object {$csv.Result -eq 'Failed'}

    But $Failed is  returning all of the files, so my where clause must be wrong

     

    Thanks

     

    • This topic was modified 4 years, 11 months ago by  OleHank.
    • This topic was modified 4 years, 11 months ago by  OleHank.
  • Thanks for posting your issue and hopefully someone will answer soon.

    This is an automated bump to increase visibility of your question.

  • without having sample data its hard to tell.

     

    but try

    $Failed  = $csv | Where-Object {$csv.Result -eq 'Failed'}|select -property Batfile

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply