如何使用四个标准参数的Pester V5配置或容器?
我正在尝试调用佩斯特脚本,从佩斯特v4.6.0到v5.3.1
我曾经使用的v4参数时,当调用佩斯特时:
-supplying custom parameters
-OutputFormat NUnitXML
-OutputFile $xmlpath
-EnableExit
但是,对于v5,我需要使用配置或使用配置或调用佩斯特一个容器,两个都没有完全满足我在V4中使用的参数。限制似乎是:
Invoke -Pester -Configuration $ Pesterconfig $ pesterconfig不喜欢我指定自定义数据参数的地方,例如: data = @{datafactoryname = $ datafactoryname;}
或
invoke -pester -container $ container -eroraction stop -output详细信息-CI $容器不喜欢我指定的地方: - 输出format nunitxml -outputfile $ xmlPath - EnableExit
我如何更有效地使用容器或配置,以允许我指定以下4件:
-supplying custom parameters
-OutputFormat NUnitXML
-OutputFile $xmlpath
-EnableExit
一项工作,是为了解决使用配置,它可以满足我的4个参数中的3个,然后将自定义数据传递给一个文件或Env变量,并在调用的PS脚本中读取它。虽然可能不是理想的。
I'm trying to invoke a pester script, moving from pester V4.6.0 to V5.3.1
The V4 arguments I used to use, when invoking pester were:
-supplying custom parameters
-OutputFormat NUnitXML
-OutputFile $xmlpath
-EnableExit
However, it seems for v5, I need to invoke Pester using either a configuration OR a container, neither of which cater fully for the arguments I used in V4. The limitations seem to be:
Invoke-Pester -Configuration $pesterConfig
where $pesterConfig doesn't like me specifying custom data params in it, eg:
Data = @{dataFactoryName = $dataFactoryName;}
or
Invoke-Pester -Container $container -ErrorAction Stop -Output Detailed -CI
where $container doesn't like me specifying:
-OutputFormat NUnitXML
-OutputFile $xmlpath
-EnableExit
How can I more efficiently use either container or configuration, to allow me to specify the following 4 things:
-supplying custom parameters
-OutputFormat NUnitXML
-OutputFile $xmlpath
-EnableExit
One work around, would be to settle for using configuration, which caters for 3 of my 4 arguments, and pass custom data to a file or env variable and read it in within the invoked ps script. Probably not ideal though.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
找到了将配置和容器一起使用的方法:
Found a way to use configuration and container together: