Pester Test

Sara 441 Reputation points
2020-09-22T14:18:25.817+00:00

I am trying to write a pester test for the following function,can someone help me on walk through me on few steps below,

Windows for business Windows Server User experience PowerShell
0 comments No comments
{count} votes

Accepted answer
  1. Rich Matheisen 47,901 Reputation points
    2020-09-22T18:52:22.31+00:00

    Pester isn't that hard to learn. Search for "Pester tutorial" and you'll find more than a few items that are helpful. If you prefer a book, there's the "Pester Book" by Adam Bertram (I used it and found it to easy to understand and got into writing tests for modules within a day or two).

    Posting the function's code isn't very helpful. You should really start by writing a few basic Pester tests and add more as you build the function. If you don't know what the function should be returning when given a set of parameters (in all possible combinations, including omitting parameters, and parameters that contain unexpected values) then you're "flying blind".

    Once you built a set of tests and your function works as expected (as defined by the tests!), you can rerun the tests after making any changes to your code to verify that you haven't mistakenly altered the output!

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.