Nunit DLL的地球

发布于 2025-01-21 17:38:44 字数 563 浏览 2 评论 0原文

我们有以下命令,该命令应搜索所有测试的dll:

packages \ nunit.consolerrunner.3.10.0 \ tools \ nunit3-console.exe - result = $ {env:ci_project_dir} \ sonite.tests.xml`; transform = nunit3-junit3-junit3-junit.xslt-nohoheader--- noheader--代理= 5 - workers = 5 - trace = off(((ls -recurse * test(s).dll |%fullName)-Match“ \ bin \”)

在管道中,我们会收到以下错误:

术语“ s”不被识别为cmdlet,函数,脚本文件或可操作的名称

我期望在 s 是可选的情况下可以使用。我在做什么错?

编辑: 我正在从powershell命令中运行它。

We have the following command which SHOULD search for all dlls of test:

packages\NUnit.ConsoleRunner.3.10.0\tools\nunit3-console.exe --result=${env:CI_PROJECT_DIR}\sonite.tests.xml`;transform=nunit3-junit.xslt --noheader --agents=5 --workers=5 --trace=Off ((ls -Recurse *Test(s).dll | % FullName) -Match "\bin\")

In the pipeline we get the following error:

The term 's' is not recognized as the name of a cmdlet, function, script file, or operable

I was expecting this to work where s is optional. What am I doing wrong?

EDIT:
I'm running it from a powershell command.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清浅ˋ旧时光 2025-01-28 17:38:44

您可以在其中使用test字符串获取所有文件,并以.dll扩展名结尾,然后检查字符串是否以test.dll结束。或tests.dll使用正则详细

(ls -Recurse *Test*.dll | ? { $_.Name -match 'Tests?\.dll

信息:

  • test - test test
  • s? - 可选的 s
  • \。dll - .dll
  • $ $ - 字符串的结尾。

注意 -match 是情况不敏感的,如果您需要情况敏感,请使用 -cmatch

} | % FullName)

信息:

  • test - test test
  • s? - 可选的s
  • \。dll - .dll
  • $ $ - 字符串的结尾。

注意-match是情况不敏感的,如果您需要情况敏感,请使用-cmatch

You can get all files with Test string in them, and end with .dll extension, and then check if the strings ends with Test.dll or Tests.dll using a regex:

(ls -Recurse *Test*.dll | ? { $_.Name -match 'Tests?\.dll

Details:

  • Test - Test
  • s? - an optional s
  • \.dll - .dll
  • $ - end of string.

Note -match is case insensitive, if you need it to be case sensitive, use -cmatch.

} | % FullName)

Details:

  • Test - Test
  • s? - an optional s
  • \.dll - .dll
  • $ - end of string.

Note -match is case insensitive, if you need it to be case sensitive, use -cmatch.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文