Open nyanhp opened 2 years ago
Thanks for the report. The PackageManagement
-module in general is unfortunately problematic due to it's use of dynamic parameters. See #2094
possibly related to #339
Thanks @fflaten I missed that issue when searching. I'll just create a function before my tests then and mock that instead :)
Checklist
What is the issue?
Mocking Get-Package results in ParameterBindingException. Get-Package is a compiled cmdlet, so I would assume that Pester should be able to mock it (unlike what happens in https://github.com/pester/Pester/issues/619)
The error, as it appears:
Expected Behavior
The mock should be executed as expected and return "A Package" instead of throwing a ParameterBindingException
Steps To Reproduce
Describe your environment
Pester version : 5.3.3 C:\Program Files\WindowsPowerShell\Modules\Pester\5.3.3\Pester.psm1 PowerShell version : 5.1.22000.653 OS version : Microsoft Windows NT 10.0.22000.0
Possible Solution?
No response