【发布时间】:2018-03-29 01:43:51
【问题描述】:
我正在尝试调试另一个开发人员的 powershell 脚本。这是运行 Powershell 5.1.16299.251 这是给我带来问题的代码行(由 --> 显示):
$CurrentProfile = $profile
$ConcourseSettings = Get-ChildItem $PSSessionRoot\Audatex.B2B.ConcourseUtilities.*\content\scripts\ConcourseSettings.ps1 -File
if($ConcourseSettings)
{
$ConcourseNugetPackage = Get-Item $PSSessionRoot\Audatex.B2B.ConcourseUtilities.*\content*
--> $ConcourseScriptsPath = $ConcourseNugetPackage | Get-Item -Path scripts
$ConcourseProjectTemplatesDir = "$ConcourseNugetPackage\dotnet" | Get-ChildItem -Filter templates
$GitIgnoreFile = "$ConcourseNugetPackage\dotnet" | Get-ChildItem -Filter gitignore -File
& $ConcourseSettings
}
如果我用 test-path 查看 $ConsourseSettings 变量,它确实显示为 true,所以我知道它正在获取该文件。这是我收到此错误的下一行:
Get-Item : 输入对象不能绑定到命令的任何参数,因为命令不接受管道输入,或者输入及其属性与接受管道输入的任何参数都不匹配。
非常感谢任何帮助。
【问题讨论】:
标签: powershell