powershell - 如何在 Azure Function Timer 触发器中调用 PowerShell Pester 测试?

标签 powershell azure azure-functions pester

执行一个 Invoke-Pester x.tests.ps1,其中包含一个 Describe block 和一个检查 bool 的 It block 。该函数失败并显示以下内容。

/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

最佳答案

您可以使用 Azure Functions Core Tools 和 --no-interactive 运行函数。请参阅https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local#run-functions-locally

关于powershell - 如何在 Azure Function Timer 触发器中调用 PowerShell Pester 测试?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44789078/

相关文章:

powershell - 从 WebJob/WebApp 访问注册表

c# - Azure辅助角色刚开始工作

azure-functions - 有关从 Visual Studio 在 Azure Function 中添加配置文件的基本问题

azure - 发布 URL https ://waws-prod-am2-xxx.publish.azurewebsites.windows.net/无法访问

azure - 如何关闭 Azure Service Fabric 的本地实例?

c# - Azure 函数静态隔离

Powershell 检查 OU 是否存在

regex - 如何增加也包含字母的字符串中的数字?

java - 如何在 powershell 中传递字符串常量

Azure 流分析 : "Output contains multiple rows …" warning