How To Test Powershell With Pester
Published 3/2025
MP4 | Video: h264, 1920x1080 | Audio: AAC, 44.1 KHz
Language: English | Size: 727.99 MB | Duration: 2h 13m
Published 3/2025
MP4 | Video: h264, 1920x1080 | Audio: AAC, 44.1 KHz
Language: English | Size: 727.99 MB | Duration: 2h 13m
Learn how to automate testing powershell using Pester in easy way
What you'll learn
By end of the Course You will be able to write the unit testing , Integration testing for powershell scripts and modules by mocking data
You will able to automate the testing of powershell scripts and modules
You will learn how to perform Code coverage of powershell
You Can easily mock the data for testing
You will be able to use the advanced assertion for complex testing
You can perform multiple similar testing with single test case
You can perform testing for Exception handling scenarios and negative scenarios
Requirements
PowerShell
Description
This is the first course for this topic which is very much needed in the IT. By end of the Course You will be able to write the unit testing , Integration testing for powershell scripts and modules by mocking data. You will be able to learn all the following below topics with simple and good ExamplesThe course has been structured in such a manner that everything will be easy to Learn and easy to understand.Framework of PowerShell TestingWhat is Describe, it and Context blocksWriting Test case under Single contextWriting Test case under Multiple contextRunning tests and interpreting resultsMocking in PesterWhat is MockingMocking custom functionMocking built-in cmdletsWhat is Before AllBefore All ExampleWhat is Before EachBefore Each Examplewhat are advanced Assert (e.g., Should -Be, Should -Contain)Assert For single values exampleAssert For Multiple values exampleExceptions Handling ScenariosExceptions Testing Example(Negative cases testing)Parameterized TestsWhat is parameterized testingParameterized tests usingCode Coverage and ReportingWhat is code coverageCode Coverage ExampleTesting trough invokingThe above topics ensures you to get started with the PowerShell testing including unit testing and integration testing and others
Overview
Section 1: Introduction
Lecture 1 Instructor Introduction & Important Note
Section 2: Pester Basics
Lecture 2 What is pester and uses of Pester
Lecture 3 Installing Pester
Section 3: Writing Tests
Lecture 4 Pester Test Structure
Lecture 5 Writing First Test Case
Lecture 6 Writing Test case under Multiple context
Lecture 7 Understanding Results
Lecture 8 Testing powerShell Script Example
Section 4: Mocking in Pester
Lecture 9 What is Mocking?
Lecture 10 Mocking Example
Lecture 11 Mocking built-in cmdlets
Lecture 12 Before Each Example
Lecture 13 Before All Example
Section 5: Working on Assertions
Lecture 14 Single values Assertions example
Lecture 15 Multiple values Assertions example
Lecture 16 Testing Exceptions Example(For Negative Scenarios)
Section 6: Parameterized Tests
Lecture 17 What is Parameterized testing or Data Driven Testing
Lecture 18 Parameterized testing example
Section 7: Code Coverage
Lecture 19 What is Code Coverage
Lecture 20 Code Coverage Example
Lecture 21 Invoke example
Section 8: Final Notes
Lecture 22 Reference
Lecture 23 Thanks You!
Who wants to Learn testing specific to powershell