How to run a PowerShell script with verbose output? : <p>I'm wondering if there's a way to run a PowerShell script such that both the commands and the output of each line of the script are printed. For example, in Bash you would write <code>bash -x myscript</code> or place a <code>set -x</code> at the top of your script. In Batch, you would omit the <code>@echo off</code> traditionally left at the top of your script. Does PowerShell have an equivalent of these constructs?</p>

<p><strong>Things I've tried:</strong> Running <code>powershell -? | sls verbose</code>, which turned up nothing.</p>
