【发布时间】:2021-08-29 12:33:51
【问题描述】:
我可以通过传递以空格分隔的文件名来成功运行单元测试。 例如
>vstest.console.exe a.dll b.dll
但是当我使用 PS 脚本做类似的事情时
> $TestDlls = Get-ChildItem -Path "Folder" -Filter "Test.*.dll" -Recurse -File
> $JoinedPath = $TestDlls -join " " #Try to join the paths by ' ' ??? Is it a wrong command?
> vstest.console.exe $JoinedPath
我得到了一些意想不到的东西......
因为 $JoinedPath 是一个带有引号的字符串,例如 "a.dll b.dll"
因此 vstest.console.exe 将始终收到单个“a.dll”(vstest.console.exe“a.dll b.dll”)
我不知道如何准确地表达我的问题......
总之,我想用powershell来模拟命令
vstest.console.exe a.dll b.dll
不是
vstest.console.exe "a.dll b.dll"
我是 PowerShell 新手,不知道是否可行。
【问题讨论】:
标签: powershell unit-testing mstest vstest vstest.console.exe