Skip to content

Can't run within a Job due to version check #12

@randallt

Description

@randallt

I'm trying to run this as part of a job (just locally for now, but eventually remotely), but the minimum version check is failing.

Importing the module like this:

Import-Module FSWatcherEngineEvent

as part of the job fails with this message:

The current Windows PowerShell host is: 'ServerRemoteHost' (version 1.0.0.0). The module 'C:\Users\...\Documents\WindowsPowerShell\Modules\FSWatcherEngineEvent\1.5.0\FSWatcherEngineEvent.psd1' requires a minimum Windows PowerShell host version of '5.1' to run.
    + CategoryInfo          : ResourceUnavailable: (C:\Users\rtheob...ngineEvent.psd1:String) [Import-Module], InvalidOperationException
    + FullyQualifiedErrorId : Modules_InsufficientPowerShellHostVersion,Microsoft.PowerShell.Commands.ImportModuleCommand
    + PSComputerName        : localhost

If I import the module outside the job, I get a different error:

The 'New-FileSystemWatcher' command was found in the module 'FSWatcherEngineEvent', but the module could not be loaded. For more information, run 'Import-Module FSWatcherEngineEvent'.
    + CategoryInfo          : ObjectNotFound: (New-FileSystemWatcher:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule
    + PSComputerName        : localhost

Is this because I only installed the module using scope "CurrentUser"? I'm on a CORP box and don't have admin privileges.
I came across this thread on reddit, but I'm not sure if it is applicable.
https://www.reddit.com/r/PowerShell/comments/s1fcvc/startjob_ps_version_inconsistency/

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