Echo equivalent in PowerShell for script testing

前端 未结 11 1578
梦如初夏
梦如初夏 2020-12-07 10:08

I would like to output variables and values out in a PowerShell script by setting up flags and seeing the data matriculate throughout the script.

How would I do thi

11条回答
  •  星月不相逢
    2020-12-07 10:26

    echo is alias to Write-Output although it looks the same as Write-Host.

    It isn't What is the difference between echo and Write-Host in PowerShell?.

    echo is an alias for Write-Output, which writes to the Success output stream. This allows output to be processed through pipelines or redirected into files. Write-Host writes directly to the console, so the output can't be redirected/processed any further.

提交回复
热议问题