title: Write-Host stopped working except under certain conditions
body: <p>I've done something to my script that has changed the default behavior of <code>Write-Host</code>, but I can't figure out what exactly. I'm stumbling from article to article trying to learn 15 years worth of powershell &quot;features&quot;/gotchas and am having no luck. My scripts primary purpose is for creating a re-usable, interactive menu system, so the output to the Host is important and not an after thought.</p>
  <p>What are the obvious/not obvious things I can check that would alter Write-Host's behavior?</p>
  <pre><code>Write-Host &quot;howdy&quot; # doesn't output anything anymore
  Write-Host &quot;howdy&quot; -ForegroundColor DarkCyan # works for any color
  Write-Host &quot;howdy&quot; | Out-Host # works
  
  &amp;docker build -f $($dockerfile.FullName) --force-rm -t $dockerTag $dockerBuildContext *&gt;&amp;1 | out-host # works
  &amp;docker build -f $($dockerfile.FullName) --force-rm -t $dockerTag $dockerBuildContext *&gt;&amp;1 # doesn't output anything anymore
  </code></pre>
  <p>I do have a function in the script for adding color to text, but even with that disabled I still have the same problem, so it must be something else.</p>
  <pre><code>function AddTextColor($message, $colorCode) {
      $escapeChar = [char]27;
      # disabled for now
      # &quot;$escapeChar[$($colorCode)m$($message)${escapeChar}[0m&quot;
      return $message;
  }
  </code></pre>
  <p>I was forced to recently change my coding style to assign <code>$null</code>'s to function calls that return objects so they wouldn't be output to the Host. I feel like this has something to do with it, but if I revert to the old way, then I'll just have garbage output to the Host everywhere which makes the menu system I'm creating useless.</p>
  <pre><code>$null = AddMenuItem @{ ParentMenu = $knownUrisSubMenu; } # new coding style to prevent the object returned from the function from being written to the host
  AddMenuItem @{ ParentMenu = $knownUrisSubMenu; } # old coding sytle, which I prefer, but produces host output
  </code></pre>