Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2314

String herausfiltern

$
0
0
Hallo,

ich möchte aus einem Logfile einen bestimmten Wert herausfiltern, um festzustellen ob in diesem Falle ein Backup erfolgreich war oder nicht. Ich habe mir gedacht, dass ich den Wert nach "Errors:" herausfiltere. Wenn der Wert 0 ist, ist das Backup in Ordnung, ansonsten nicht. Kann mir jemand helfen wie man diesen Wert herausbekommt. Ich habe es schon soweit hinbekommen, dass ich jede Zeile dieses Logfiles in einem Array habe. Jetzt gehts nur mehr um den einzelnen String.

Vielen Dank!!!!!

Logfile:

2015-01-23 08:35 Changing the history item to Parked. Reason: not creating separated backups
    2015-01-23 08:35 Deleting the Volume Shadow Copy snapshot "d79bc90e-ebd3-47e9-81a3-ed214eaf21d5"
    2015-01-23 08:35 The Volume Shadow Copy snapshot set has been successfully deleted
    2015-01-23 08:35 Total backup time for "File Backup": 0 hours, 1 minutes, 0 seconds
    2015-01-23 08:35 ** Backup done for the task "File Backup". Errors: 138. Processed files: 9085. Backed up files: 40. Total size: 31,62 MB **
    2015-01-23 08:35 --
    2015-01-23 08:35 The system can now enter sleep mode
    2015-01-23 08:35 Total backup time: 0 hours, 1 minutes, 4 seconds
    2015-01-23 08:35 *** Backup done.  Errors: 138.  Processed files: 9085. Backed up files: 40. Total size: 31,62 MB ***
    2015-01-23 08:35 --
    2015-01-23 09:31 Checking for new versions...
    2015-01-23 09:31 Your program is up to date


Viewing all articles
Browse latest Browse all 2314


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>