我们在Windows上使用Splunk,在最新版本中,我们现在需要将脚本化警报迁移到定制警报。长话短说,新框架不再使用位置参数,而是使用有效载荷(stdin)。如果使用Python,它很简单,如Spunk documentation
settings = json.loads(sys.stdin.read())
我不知道如何使用Powershell实现同样的功能。cmdlet read host仅从键盘读取stdin。我还发现了使用cmdlet get content从stdin读取的示例,但我只找到了使用现有文件时的示例
Get-Content c:\scripts\test.txt
可能是我需要做一些与this accepted answer中描述的内容相关的事情。在
^{pr2}$但是我不想发送到另一个进程的stdin,我想阅读另一个进程发送到“我的”进程的Powershell脚本。在
使用automatic variable
$input
:相关问题 更多 >
编程相关推荐