Question: Modify the script created to output to a file. Create a Task to Run the new script. The Task should run 3-5 minutes after it

Modify the script created to output to a file. Create a Task to Run the new script. The Task should run 3-5 minutes after it is set-up.

(adjust file location in line 2 accordingly)

CLS $file = new-object System.IO.StreamReader("C:/Powershell/OnCallIncidentLog.txt") try { while (($line = $file.ReadLine()) -ne $null) { if ($line.Contains("@")) # do something with $line here { $line = ($line.Split("@")[1]) $line = ($line.Split()[0]) $line } } } finally { $file.Close() }

-------------------

OnCallIncidentLog.txt (copy into the .txt provided)

Date Oncall Email Incidents 1-Jan-15 Lat.Dress@mct.edu 0 15-Jan-15 He.Weiz@watc.org 3 29-Jan-15 Wil.Jou@gway.org 6 12-Feb-15 Sam.Jan@mct.edu 6 26-Feb-15 Cas.Tard@watc.org 3 12-Mar-15 Phi.Ferr@mctc.edu 1 26-Mar-15 Ros.Derr@wat.edu 4 9-Apr-15 Ka.Shir@way.org 1 23-Apr-15 Ari.Putho@watc.org 6 7-May-15 Ros.Sarta@gway.edu 0 21-May-15 Jac.Gant@mctc.org 0 4-Jun-15 Sar.Guar@watc.edu 2 18-Jun-15 Me.Ohle@way.edu 4 2-Jul-15 Yol.Marti@mctc.org 3 16-Jul-15 Vic.Rolh@watc.org 9 30-Jul-15 To.Patri@mct.edu 0 13-Aug-15 Fre.Aras@watc.org 0 27-Aug-15 Mic.Tell@mct.edu 3 10-Sep-15 Myr.Gim@watc.edu 1 24-Sep-15 Ca.Ma@gway.org 2 8-Oct-15 Mel.Link@mctc.org 2 22-Oct-15 Val.Cald@wat.edu 9 5-Nov-15 Dar.Edmun@gway.org 4 19-Nov-15 Eli.Kenn@mctc.edu 1 3-Dec-15 Gen.Carr@watc.edu 2 17-Dec-15 Gen.Copla@mctc.org 2 31-Dec-15 Oni.Den@watc.org 2 14-Jan-16 Ra.Bes@gway.edu 0 28-Jan-16 Jan.All@mctc.org 5 11-Feb-16 Bo .Muis@watc.edu 5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!