2

Doing an Invoke-Pester x.tests.ps1 that contains a Describe block and an It block that checks a bool. The function fails with the following.

/ServiceStatus/modules/Pester_3.4.6/Pester.psm1
2017-06-27T20:19:39.503 Function completed (Failure, Id=ffacbf52-7871-4c88-a831-8664d9b57bf8, Duration=1992ms)
2017-06-27T20:19:39.550 Exception while executing function: Functions.ServiceStatus. System.Management.Automation: A command that prompts the user failed because the host program or the command type does not support user interaction. Try a host program that supports user interaction, such as the Windows PowerShell Console or Windows PowerShell ISE, and remove prompt-related commands from command types that do not support user interaction, such as Windows PowerShell workflows.
View files
Test
Request body
1


Find
No results

Output
 Status: 202 Accepted
Janusz Nowak
  • 2,595
  • 1
  • 17
  • 36
Doug Finke
  • 6,675
  • 1
  • 31
  • 47
  • 1
    You need to post the actual error message in full. The valuable part of the error is entirely truncated from your image. – Bacon Bits Jun 27 '17 at 20:16
  • The error seems to suggest that your code is prompting for user input, but the host doesn't support that. This is weird as I don't think Pester ever prompts for input. Try using `-Show None` to suppress the output (this is the equivalent of `-Quiet` which is apparently being deprecated). – Mark Wragg Jun 27 '17 at 21:04

1 Answers1

2

You can run a function with the Azure Functions Core Tools with --no-interactive. See https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local#run-functions-locally.

lindydonna
  • 3,874
  • 17
  • 26