Posted: 2013-01-31 12:54
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.
You can post new topics in this forum
And it's free!