Run certain tests at different "time"

I am a newbie and start to investigate Pester for our use case below.

Use case: We have an automation process that creates VMs. Throughout the process, where we have multiple phases, depending on where we are in such a particular phase, we want to run certain test cases only before we move on to the next phase of the automation.

Question: How would we accommodate that in Pester? Say we want to run test case 1-10 out of 50 for phase 1 and 11-20 for phase 2 and the rest next.


This question is too broad. We have no information about how your ‘automation’ works, or what you’re trying to ‘test’. Even if we did, the best thing you can probably do if you’re trying to evaluate if Pester may work for you, is to start playing around with it (not necessarily as part of your specific use case, but just to get a feel for how it works), and build from there.

Often, pester is used in CI/CD pipelines. For example, let’s say you have a PS module you want to build and deploy to some servers. You can use pester to make sure your commands work as expected. I’ve only personally dabbled with Pester, but my understanding is, it’s pretty versatile, and it can be ran ad-hoc/locally, not just part of a devops pipeline.

To that end, I suggest you should start here and review the documentation: Quick Start | Pester

Next: setup some pester tests just to get a feel for what you can do. Start simple and build from there.

Then, once you feel like you have learned how to do some things, try to start building pester tests and see if it might work for your workflow. At that point, you’ll be able to ask more specific questions, as you’ll have a process, a test in place, and a goal in mind, and that’ll give folks who may help you a much better shot at helping you overcome your problem, or suggesting you go a different route.