Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

How do I solve Write-Host failures in DSC?

$
0
0

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:


Viewing all articles
Browse latest Browse all 6937

Trending Articles