| Profilo di RichardRichard Siddaway's BlogFotoBlogElenchi | Guida |
|
09 novembre Getting Change EventsI wasn’t particularly happy with the script for getting change events on the filesystemwatcher we discussed last time. As a quick recap we ended up with this
Which depends on the correct identification of the order in which events are issued. That seemed like too much manual intervention. It was too late last night to solve so I had another look today and came up with this
use get-event with the correct source identifier. We then group on timegenerated. File Changes will generate two change records per event so we select where the count is 2. Pass those into a foreach and retrieve the events matching that time. We select the first one of each pair to only access a single record. One neat line of PowerShell does it all. CommentiPer aggiungere un commento, accedi con il tuo Windows Live ID (se utilizzi Hotmail, Messenger o Xbox LIVE possiedi già un Windows Live ID). Accedi Non hai ancora un Windows Live ID? Registrati RiferimentiL'URL di riferimento per questo intervento è: http://richardsiddaway.spaces.live.com/blog/cns!43CFA46A74CF3E96!2602.trak Blog che fanno riferimento a questo intervento
|
|
|