什么是Powershell';s相当于Pythons sys.stdin.read()?

什么是Powershell';s相当于Pythons sys.stdin.read()?,python,powershell,stdin,Python,Powershell,Stdin,我们正在Windows上使用Splunk,在最新版本中,我们现在需要将脚本警报迁移到自定义警报。长话短说,新框架不再使用位置参数,而是使用有效负载(stdin)。如果使用Python,它很简单,如中所示 settings=json.load(sys.stdin.read()) 我一直无法想出如何使用Powershell实现同样的功能。cmdlet read host仅从键盘读取stdin。我还找到了使用cmdlet get content从stdin读取的示例,但我只找到了使用现有文件的示例 G

我们正在Windows上使用Splunk,在最新版本中,我们现在需要将脚本警报迁移到自定义警报。长话短说,新框架不再使用位置参数,而是使用有效负载(stdin)。如果使用Python,它很简单,如中所示

settings=json.load(sys.stdin.read())

我一直无法想出如何使用Powershell实现同样的功能。cmdlet read host仅从键盘读取stdin。我还找到了使用cmdlet get content从stdin读取的示例,但我只找到了使用现有文件的示例

Get-Content c:\scripts\test.txt
可能我需要做一些与中描述的相关的事情

但我不想发送到另一个进程的stdin,我想读取另一个进程发送到“我的”进程的内容,Powershell脚本

使用
$input

$settings = $input | Out-String | ConvertFrom-Json

有帮助吗?看不出是否直接重复。呜呜呜!多么简单和容易!!非常感谢!!
$settings = $input | Out-String | ConvertFrom-Json