New-PesterContainer
#
SYNOPSISGenerates ContainerInfo-objects used as for Invoke-Pester -Container
#
SYNTAX#
Path (Default)#
ScriptBlock#
DESCRIPTIONPester 5 supports running tests files and scriptblocks using parameter-input. To use this feature, Invoke-Pester expects one or more ContainerInfo-objects created using this funciton, that specify test containers in the form of paths to the test files or scriptblocks containing the tests directly.
A optional Data-dictionary can be provided to supply the containers with any required parameter-values. This is useful in when tests are generated dynamically based on parameter-input. This method enables complex test-solutions while being able to re-use a lot of test-code.
#
EXAMPLES#
EXAMPLE 1This example runs Pester using a generated ContainerInfo-object referencing a file and required parameters that's provided to the test-file during execution.
#
EXAMPLE 2This example runs Pester agianst a scriptblock. New-PesterContainer is used to genreated the requried ContainerInfo-object that enables us to do this directly.
#
PARAMETERS#
-PathSpecifies one or more paths to files containing tests. The value is a path\file name or name pattern. Wildcards are permitted.
#
-ScriptBlockSpecifies one or more scriptblocks containing tests.
#
-DataAllows a dictionary to be provided with parameter-values that should be used during execution of the test containers defined in Path or ScriptBlock.
#
CommonParametersThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
#
INPUTS#
OUTPUTS#
NOTES#
RELATED LINKShttps://pester.dev/docs/commands/New-PesterContainer
https://pester.dev/docs/commands/Invoke-Pester
https://pester.dev/docs/usage/data-driven-tests
#
EDIT THIS PAGEThis page was auto-generated using the comment based help in Pester 5.1.1. To edit the content of this page, change the corresponding help in the pester/Pester repository. See our contribution guide for more information.