About 970,000 results
Open links in new tab
  1. Practical PowerShell Unit-Testing: Mock Objects - Simple Talk

    Nov 4, 2014 · This article showed how to make one test function actually cover multiple test cases; PowerShell makes that particularly easy to do. It also introduced mocks, which, as you …

  2. Mocking with Pester in PowerShell unit testing4sysops

    Jul 26, 2016 · Unit tests are used to verify the behavior of a certain part of your PowerShell code. With mocking in Pester, you can mimic the behavior of commands referenced by the unit you …

  3. Unit Testing PowerShell Code with Pester - Scripting Blog …

    Dec 16, 2015 · Unit tests are responsible for verifying the behavior of a single unit of code, which in PowerShell, typically means a function. If the function you are testing depends on anything …

  4. Using Parameters in your Pester Test Scripts -- Microsoft …

    Nov 9, 2017 · Once we've got the parameters defined at the top and the static value references replaced with parameter variables inside of the script, we now need to pass these parameters …

  5. unit testing - Powershell import script with parameter - Stack Overflow

    Jul 5, 2018 · I would like to import my main script in my test script (for unit tests) but with . ("P:\Documents\PS\ppmc_Cronet_Interface.ps1") or Import-Module …

  6. Unit testing in PowerShell - Post | John Louros

    Dec 13, 2016 · Unit test your PowerShell scripts with Pester. As described on Pester's GitHub repository "Pester provides a framework for running unit tests to execute and validate …

  7. PowerShell Script Parameters: Getting Started Guide

    Feb 27, 2024 · Defining Parameters. You define parameters using the param() keyword along with a dollar sign ($) and a parameter name, just like a variable. The example below is a …

  8. Practical PowerShell Unit-TestingPowerShell.org

    May 22, 2016 · To be able to create true unit tests, you need to be able to isolate your functions and modules to be able to focus on the component under test; mocks provide great support for …

  9. How To Create Parameters In PowerShell Step By Step

    Follow these steps in order to create the PowerShell Parameter (s): Use param () statement right after function definition to define all the input parameters within it. This step is done only once! …

  10. Unit testing in PowerShell, introduction to Pester

    Jul 2, 2019 · Inside the It bloc; you need to pass the data as parameters and get their value in parameters variables. You can virtually run pester in any PowerShell file but by convention, it’s …

  11. Some results have been removed