Groups
Groups
Sign in
Groups
Groups
Pester
Conversations
About
Send feedback
Help
How mock user interaction New-Object System.Management.Automation.Host .ChoiceDescription ?
20 views
Skip to first unread message
Wojciech Sciesinski
unread,
Nov 10, 2016, 6:37:23 PM
11/10/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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 PM
11/12/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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