Powershell管道未通过invoke-expression传递

时间:2019-01-07 18:02:07

标签: powershell pipeline invoke

powershell新手在这里。我正在尝试从当前脚本中调用另一个脚本,但是'$ _'从未通过它。

invoke-expression "$cleanScript -pattern $ageDir -days2keep $ageDays | ? {$_.keep -eq $false}"

keep : The term '.keep' is not recognized as the name of
At line:1 char:112
+ ... :\backup\archive\*.zip -days2keep 14
+
    + CategoryInfo          : ObjectNotFound: (.keep:Strin
    + FullyQualifiedErrorId : CommandNotFoundException

有什么主意要怎么做吗?

0 个答案:

没有答案