Skip to content
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

powershell_ise processes are left around once PoshRSJob module is loaded #124

Closed
codykonior opened this issue Feb 17, 2017 · 0 comments
Closed

Comments

@codykonior
Copy link
Contributor

codykonior commented Feb 17, 2017

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
When you close PowerShell ISE, even if you've loaded a module, the process should and will disappear from Task Manager. If you simply open ISE, Import-Module PoshRSJob, and then exit the process will never disappear from Task Manager. I waited > 15 minutes so it's not a timer (or it's a very long timer!)

This happens on 1.7.3.5 and all the way back - even on 1.3.0.0 (which didn't load properly) it still caused ISE to be orphaned in the background. Also it happens on ISE x86 and x64 but it doesn't happen on either Console version. I tested on multiple PowerShell v5/v5.1 servers to be sure.

It seems to be caused by the two cleanup jobs in PoshRSJob.psm1. If you modify their two loops to exit after the first go then PowerShell ISE closes fine. This means that the .Flag properties they're checking which are set by $ExecutionContext.SessionState.Module.OnRemove aren't being triggered properly. But I'm not sure why or of a workaround.

Which versions of Powershell and which OS are affected by this issue? Did this work in previous versions of our scripts?

It appears this has always been the case, but, I don't know how I've never picked it up before (as I often looked for and killed orphaned sessions in case they were bugs in my scripts).

Windows Server 2012 R2.

Name                           Value                   
----                           -----                   
PSVersion                      5.0.10586.117           
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...} 
BuildVersion                   10.0.10586.117          
CLRVersion                     4.0.30319.42000         
WSManStackVersion              3.0                     
PSRemotingProtocolVersion      2.3                     
SerializationVersion           1.1.0.1                 
proxb added a commit that referenced this issue Feb 20, 2017
#124 fix powershell_ise processes
@proxb proxb closed this as completed Feb 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants