How mock user interaction New-Object System.Management.Automation.Host .ChoiceDescription ?

18 views
Skip to first unread message

Wojciech Sciesinski

unread,
Nov 10, 2016, 6:37:23 PM11/10/16
to Pester
Hi,
if someone of you know if/how can be mocked user interaction taken using "New-Object System.Management.Automation.Host.ChoiceDescription" ?

Thank you in advance for any help.

Wojciech

Wojciech Sciesinski

unread,
Nov 12, 2016, 6:47:06 PM11/12/16
to Pester

I resolved that issue by moving part of code to a separate function. Then a mocked that function.

Details you can find here: https://github.com/it-praktyk/New-OutputObject/blob/master/Private/Get-OverwriteDecision.ps1 .

Mocked code is a part of New-OutputObject the PowerShell module intended for preparing PowerShell objects what help output filesystem objects (files and folders). The module is published to PowerShell Gallery also.
Reply all
Reply to author
Forward
0 new messages