-
Let's say I want to log what values are passed to It seems that I can't just do something like this: $global:writeHostStrings = [System.Collections.Generic.List[object]]::new()
Mock Write-Host {
# Log or track some of the parameters Write-Host was called with
$global:writeHostStrings += $Object
# Then actually execute the original function
Write-Host @PesterBoundParameters
} Is there a straightforward way to do this in Pester? I've found that this just continues to call the mocked functions alias and repeats infinitely. |
Beta Was this translation helpful? Give feedback.
Answered by
nohwnd
Jun 24, 2021
Replies: 1 comment 1 reply
-
Yes, you would do:
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
efie45
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, you would do: