Click here for important information about

How can i output an event trigger to .txt file?

August 14, 2017 at 23:43:43
Specs: Windows 10

I am new to scripting and i want to create a simple script that creates a .txt file on an event trigger. When the Microsoft Windows Backup is completed (event id 4) i want it in a .txt file. So i can do this to every server so the results are coming in 1 file. I thought i could do a trigger on an event and do the action like this:

Start a Program: powershell.exe -Noprofile -executionpolicy bypass -file "C:\Scripts\Log.ps1

Log.ps1 = Out-File > C:\Log\test.txt

What am i doing wrong?

See More: How can i output an event trigger to .txt file?

August 15, 2017 at 09:11:13
ExclusiveTweety: What am i doing wrong?
Well, let's see. You don't mention exactly what's going wrong, nor do you mention what you expect your log file to contain, nor do you say what it actually contains. Also, if that's really the entirety of your script, then you have a command with a missing argument, and effectively two output commands while neglecting to output anything.

How To Ask Questions The Smart Way

Report •
Related Solutions

Ask Question