【发布时间】:2018-05-16 17:12:12
【问题描述】:
运行 powershell 脚本时出现以下错误
设置位置:无法将“System.Object[]”转换为参数“Path”所需的类型“System.String”。指定的 错误 15-May-2018 08:31:42 方法不受支持。
以下是有问题的脚本,请您在这里提出问题
cd $lsolutionPath
Get-ChildItem -Path "$lsolutionPath" -Filter "*Tests" -Recurse -Directory | where {$_.FullName -inotlike "*.sonarqube*"} | ForEach-Object {
$fullName = $_.FullName
$projName = $_.BaseName
write-output $projName
write-output $fullName
Write-Output "Starting Build Helper unit test run:3"
$tests = Get-ChildItem -Path "$fullName" -Recurse -Include *.dll
Write-Output "Starting Build Helper unit test run:4"
if($tests -eq $null) {
Write-Error "Could not find *Tests.dll"
return 999
}
cd $tests.Directory
Write-Output $tests.Directory
Write-Output "target args"
$targetArgs = "\""$tests\"" -nologo -parallel none -noshadow -xml \""$xUnittestResultsPath\$projName.xml\"" -nunit \""$testResultsPath\$projName.xml\"""
Write-Output "$target args"
Write-Output "###### Target Args:"**
【问题讨论】:
标签: powershell