You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Background operator (&) seems to have dependency on Windows PS #11257
changed the title [-]Background operator (&) seems to have dependency on Windows PS starting with 7.0-preview6[/-][+]Background operator (&) seems to have dependency on Windows PS[/+]on Dec 3, 2019
I had the same message in VS code for no obvious reason this afternoon. And on my home pc cmd /c dir &
gets the result above
I tried breaking the psscheduledJob module (take ownership and assign full control, and rename the psd1 file). cmd /c dir & still works, but the module is not loaded and the message doesn't appear. So I think this is something odd about that module, not the & operator.
James O'Neill (@jhoneill) I'd try to repro without your profile loaded, as you may have some code in your profile that is triggering the attempted loading of the winPS module.
This happens because when using a PSJob cmdlet, PowerShell will try to import modules that implement the JobAdapter. With the new WinPS code path, it imports ScheduledJob module since it implements JobAdapter. It does this because ScheduledJob (along with PSWorkFlow) support serialized jobs. This means that when you do Get-Job, it will find and show these jobs. But to be able to do that, it has to load those modules and get them to enumerate their jobs. Since ScheduledJob doesn't actually work with PowerShell 7 and PSWorkFlow is already not supported, the fix is to not automatically load these two modules.
James O'Neill (@jhoneill) I'd try to repro without your profile loaded, as you may have some code in your profile that is triggering the attempted loading of the winPS module.
Just tried that ... no change :-( It's possible that some of the other cases where modules autoload for reasons I can't see are caused by something in my profile. But it happens rarely and I haven't stopped what I've been doing to investigate, so I don't have any kind of pattern of "x will auto-load if I do Y". It sounds like Steve has explained what causes this module to load and there is already a fix in the works :-)
Steve Lee (@SteveL-MSFT) so it still tries to load modules which implement the jobadapter but has a hard coded exception for one or two ?
Activity
[-]Background operator (&) seems to have dependency on Windows PS starting with 7.0-preview6[/-][+]Background operator (&) seems to have dependency on Windows PS[/+]jhoneill commentedon Dec 4, 2019
I had the same message in VS code for no obvious reason this afternoon. And on my home pc
cmd /c dir &gets the result above
I tried breaking the psscheduledJob module (take ownership and assign full control, and rename the psd1 file).
cmd /c dir &still works, but the module is not loaded and the message doesn't appear. So I think this is something odd about that module, not the & operator.vexx32 commentedon Dec 4, 2019
/cc Paul Higinbotham (@PaulHigin)
James O'Neill (@jhoneill) I'd try to repro without your profile loaded, as you may have some code in your profile that is triggering the attempted loading of the winPS module.
SteveL-MSFT commentedon Dec 4, 2019
This is already fixed via #11194
This happens because when using a PSJob cmdlet, PowerShell will try to import modules that implement the JobAdapter. With the new WinPS code path, it imports ScheduledJob module since it implements JobAdapter. It does this because ScheduledJob (along with PSWorkFlow) support serialized jobs. This means that when you do
Get-Job, it will find and show these jobs. But to be able to do that, it has to load those modules and get them to enumerate their jobs. Since ScheduledJob doesn't actually work with PowerShell 7 and PSWorkFlow is already not supported, the fix is to not automatically load these two modules.jhoneill commentedon Dec 4, 2019
Just tried that ... no change :-( It's possible that some of the other cases where modules autoload for reasons I can't see are caused by something in my profile. But it happens rarely and I haven't stopped what I've been doing to investigate, so I don't have any kind of pattern of "x will auto-load if I do Y". It sounds like Steve has explained what causes this module to load and there is already a fix in the works :-)
Steve Lee (@SteveL-MSFT) so it still tries to load modules which implement the jobadapter but has a hard coded exception for one or two ?
bergmeister commentedon Dec 4, 2019
Thanks, I can confirm, it is not happening any more with the daily build