Skip to content

When running -AsJob, imports are only recognized if terminated with a semicolon #2

@msorens

Description

@msorens

When generating a monitor as a background job (via -AsJob), the system has to understand your imports defined by Add-PSSnapin and Import-Module. These must precede any other code and should be recognizable when terminated either by a line break or a semicolon. V1.0.0. is only accepting the semicolon, though.

Example:
This fails because two of the three imports are using line breaks:

Start-Monitor -AsJob { 
    Add-PSSnapin Microsoft.TeamFoundation.PowerShell
    import-module foo.bar; 
    import-module xyz
    Get-StaleTfsFiles C:\MyTfsRoot\Trunk 
}

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