Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

lduczmal

output from eventhandler

Hi,
I'm trying to modify example of event "FileTransfered" handler published as part of Session.SynchronizeDirectories Method powershell example. This handler use write-host cmdlet to display messages produced by the eventhandler. It works fine, but I need output from the handler futher in my main script so I need put this output to variable seen in main script. I tried to use "$script:variable" but it doesn't work: in eventhandler script block correct value is seen, but in main script it is empty. I can create temporary file from eventhandler, put there output message and finally read this file from main script but is isn't good solution.
Please help
Łukasz Duczmal