You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Passing arguments to pester when using Invoke-MTTest #19
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?
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.
Activity
belibug commentedon Dec 11, 2025
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.
belibug commentedon Dec 12, 2025
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)