Is it possible to check if -Verbose argument was given in Powershell?

前端 未结 5 1094
温柔的废话
温柔的废话 2021-02-07 02:35

I have written my own Powershell logging function Log with parameters stream (on which stream to write the message) and message (the messa

5条回答
  •  一生所求
    2021-02-07 02:36

    If you're determining whether or not to print depending on the value of the -Verbose parameter, consider using Write-Verbose instead of Write-Host: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/write-verbose?view=powershell-7.1

提交回复
热议问题