Registering an Event Handler

Advertisement

aksarben
Joined:
Posts:
68

Registering an Event Handler

After reading the description of $session.add_FileTransferProgress, I had a question:

Does an event handler have to be a standalone function, or can it be a method inside a class?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,034
Location:
Prague, Czechia

Re: Registering an Event Handler

Again, this is a PowerShell, not a WinSCP question.
I'm not a PowerShell expert, but what you pass to the add_* method is a script block. The script block can contain anything, function call, method call, or even a complete implementation.

Reply with quote

Advertisement

You can post new topics in this forum