How can I execute scripts in a code created powershell shell that has Write-Host commands in it?

后端 未结 3 949
野性不改
野性不改 2021-01-08 00:06

I have a script that I am writing which relies on functions in an imported module. This script takes a while due to IO (web requests) and I would like to parallize it for h

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-08 00:53

    If you need the output, you can use:

    $ps.addscript("function write-host($out) {write-output $out}").invoke()
    $ps.commands.clear()
    

提交回复
热议问题