-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New authentication event on each invoke call on the same ps object #166
Comments
This is expected and how the native Windows PowerShell client works. Each Runspace Pool and Pipeline spawn a background listener thread. These threads must be run on a new connection which means they must reauthenticate themselves so in this script example you will see:
The primary reason why this is done is the runspace pool and/or pipeline can send back events that are handled as they come in rather than through something that blocks the main thread. This enables the following
|
Thank you for the explanation. The thing that I don't fully comprehend - aren't the above invoke running on the same pipeline?
Here I see three logon events generated for the wstest user irrespective of the number of invoke calls. Shouldn't the behavior be similar for both programs, or is there something basic I'm missing? Thanks again for all the help! |
Hmm, I'll have to look into that and maybe rework it. I always assumed that each receive operation (which starts per invocation) was on the separate thread and thus separate connection. |
Hi Jordan,
I'm observing a logon event for each invoke call on the same PS object. Sample code
The above code generates a large number of logon events. Notably, each invocation of the invoke function call is performing a logon.
Considering that I'm using a SyncRunSpacePool and SyncPowerShell instance on the same ps object, shouldn't there be one logon and then reuse the session rather than a logon? Am I missing something here, or have you noticed similar things? Thank you for all your help.
Edited the domain and password.
The text was updated successfully, but these errors were encountered: