Skip to content

Issue with #Requires -Modules PoSHRSJob #211

@jamesringer

Description

@jamesringer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions