bjpeck28
-
Total Posts
:
1
- Scores: 0
-
Reward points
:
0
- Joined: 12/6/2011
-
Status: offline
|
comparing files for changes
Tuesday, December 06, 2011 12:21 PM
( permalink)
Hey guys.. i am fairly new to Powershell here and I am trying to write a script that will allow me to "keep an eye" on the file and then write an event in my event log telling me that something was changed to that file. I really want to base it off of the "write time". Is there a way to do such a thing? I have the commands to create the file and folder, but I just need direction on how to run the looping process. any help is appreciated.. thanks guys!!!
|
|
|
|
ebgreen
-
Total Posts
:
8227
- Scores: 98
-
Reward points
:
0
- Joined: 7/12/2005
-
Status: offline
|
Re:comparing files for changes
Wednesday, December 07, 2011 3:27 AM
( permalink)
You could run a scheduled task to look at the last modified time of the file then compare that to the last time that the script ran. Usually for this sort of task however I use a WMI Event Sink to make a script fire whenever the file is modified.
|
|
|
|