【问题标题】:How to make script take STDIN from file and/or other script如何使脚本从文件和/或其他脚本中获取 STDIN
【发布时间】:2017-02-18 04:11:47
【问题描述】:

如何将 STDIN 发送到脚本中?

script1.ps1

script1.ps1:

if(input from file.txt = "string1")
{
//do code
}

【问题讨论】:

    标签: stdin


    【解决方案1】:

    答案是使用 $input 环境变量,这个变量存储管道输入,然后在你的脚本中你可以用它来做你的代码。

    【讨论】:

      猜你喜欢
      • 2011-05-01
      • 2016-12-03
      • 2020-01-28
      • 1970-01-01
      • 1970-01-01
      • 2010-10-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多