Q. I have a PowerShell script that uses Write-Host but it causes it to fail in certain scenarios including using DSC, what can I do?
A. The easiest way to handle scripts that call Write-Host is to replace the Write-Host with Write-Verbose. A very way to solve this outside of changing the actual script/module is to create an alias which changes Write-Host to Write-Verbose! For example:
New-Alias Write-Host Write-Verbose
0 comments
Hide comments