Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
win_pester path behavior changed to match Pester behavior #56677
Fix supplying directory path to only execute *.tests.ps1 files, using Pester's built-in test searching functionality.
Previously, win_pester would search for '.ps1' files in the directory supplied to 'Path:', and then execute 'Invoke-Pester' against each file. This is different from Pester's behavior, which only executes against '.tests.ps1' files. Due to this divergent behavior, the win_pester module could inadvertently execute code that changes your system state when you are attempting to execute tests.
Pester also will search supplied paths itself, so searching for the files to execute within the win_pester module was unnecessary.
Also, I converted the module from using 'Ansible.ModuleUtils.Legacy' to using 'Ansible.Basic'
The behavior when a single test file is passed has not changed.