proxb / PoshRSJob

Provides an alternative to PSjobs with greater performance and less overhead to run commands in the background, freeing up the console and allowing throttling on the jobs.
MIT License
541 stars 87 forks source link

Issue with #Requires -Modules PoSHRSJob #211

Open jamesringer opened 4 years ago

jamesringer commented 4 years ago

Test.zip

I'm new to PowerShell so excuse me if I use poor terminology or don't fully understand concepts. I have a collection of functions/scripts I combined in a module for personal use.

A couple of the functions use PoSHRSJob. I'm checking for and loading PoSHRSJob using #Requires -Modules PoSHRSJob. I noticed an issue with tab completion. After some trouble shooting I determined the issue occurs after I import my module and remove my module. I narrowed this down to the TabExpansion2 function.

Prior to importing my module the the TabExpansion2 function is available (no source). After I've imported my module TabExpansion2 is available, but the source is changed to my module. Then if I remove my module the TabExpansion2 function is no longer available. I work around this by restarting PowerShell.

The issue seems to be related to #Requires -Modules PoSHRSJob. When I use Import-Module PoSHRSJob instead the issue does not occur. The files in the zip can reproduce the issue by importing test.psm1. There is a picture in the screenshots folder demonstrating the issue.