Skip to content

Unable to Access Function in Module from Start-RSJob #184

@adamfortuno

Description

@adamfortuno

I'm running PoshRSJob v1.7.4.4 on Powershell v5.1.15063.1029 on Windows 10.

I'm navigating to a folder named "Coffee.Application" with the following files:

  1. Coffee.Application.ps1
  2. Coffee.Application.psm1

I then run the following:

Start-RSJob -ScriptBlock { Get-CoffeeDBConnectionString } `
	-Name t1 `
	-ModulesToImport .\Coffee.Application.psm1

Receive-RSJob -Name t1

Receive-RSJob -Name t1, returns the following error:

The term 'Get-Foo' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

The function Get-Foo is in the module Coffee.Application. I expected the thread to be able to execute the Get-Foo function in the Coffee.Application module.

The module's script file is in the current workspace. I can load the module into the active session with the following:

import-module .\Coffee.Application.psm1

Once loaded, I can access any exposed functions.

I have tried closing all session. Starting a fresh session and making the call to Start-RSJob the first call made.

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