I have a section in my code where if specific criteria isn’t met, it causes a break which ends command execution. This is expected and by design, but now I am writing a Pester test for it and not sure how assert that a break just took place.
In addition, since Write-Host is pretty much against the law, I saw a Microsoft article stating to use [Console]::WriteLine() in place of Write-Host. I am wondering I should change this to something else that writes output for the user to see.
Your thoughts/suggestions are welcomed!