Dmi*_*kov 4 powershell console
当我Start-Job {dir}
在 PowerShell 中运行命令时,我得到输出
Id Name State HasMoreData Location Command
-- ---- ----- ----------- -------- -------
43 Job43 Running True localhost dir
Run Code Online (Sandbox Code Playgroud)
我怎样才能让这个工作把它的输出写到控制台?
这是通过receive-job
cmdlet处理的。
$job = Start-Job { dir }
Receive-Job $job
Run Code Online (Sandbox Code Playgroud)
如果HasMoreData
您的get-job
输出为真,您只会获得数据。这将作为一个数组返回,每个数组元素有一行文本。
help about_jobs
将为您提供有关如何与一般工作互动的相当多的细节。
归档时间: |
|
查看次数: |
9268 次 |
最近记录: |