Skip to content

Passing arguments to pester when using Invoke-MTTest #19

Open

Description

@Kvoo

Is there any plan to extend Invoke-MTTest's functionality to allow passing arguments to pester?

One of the functions I want to test needs a PSCredential passed to it to work properly. If I want to test that using ModuleTools, I'd have to include the credentials as plain text in the .Test.ps1 file. Is there another way that I'm missing?

I'm also not quite clear on something else: Does Invoke-MTTest test the built .psm1 or the seperate .ps1 files in the src directory?

Activity

  1. belibug commented on Dec 11, 2025

    @belibug
    Owner

    I have faced this challenge myself. But its for running specific tests with tags and parameters. But not for credential. ModuleTools was bulit to handle pipelines and automated builds with no interactive prompts.

    For credentials especially I strongly recommend you to check out Microsoft SecretStore. It will significantly help you store and manage secrets (like pscredentials) securely and scales very well when you run your builds as CICD.

  2. belibug commented on Dec 12, 2025

    @belibug
    Owner

    You can also use Invoke-MTTest -TagFilter "xyz" to run specific tags in Pester (so that you dont run whole pester for every run or testing)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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