How do I solve Write-Host failures in DSC?

Fix pesky Write-Host issues in your PowerShell DSC with ease

John Savill

June 9, 2015

1 Min Read
How do I solve Write-Host failures in DSC?
Getty Images

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

 

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like