tag:help.appveyor.com,2012-11-13:/discussions/problems/62-how-do-i-increase-the-logging-level-for-the-deployment-logAppVeyor: Discussion 2018-08-25T01:37:22Ztag:help.appveyor.com,2012-11-13:Comment/308043452013-12-28T17:06:33Z2013-12-28T17:06:33ZHow do I increase the logging level for the deployment log?<div><p>Hi Rupert,</p>
<p>To enable verbose logging I would do an additional "wrapping"
<code>deploy-verbose.ps1</code> script that looks like below:</p>
<pre>
<code># call deploy.ps1 in the same directory with -verbose switch
$scriptsPath = Split-Path -Parent $MyInvocation.MyCommand.Definition
. (Join-Path $scriptsPath "deploy.ps1") -Verbose</code>
</pre>
<p>To make -verbose switch work <code>deploy.ps1</code> script must
have <code>[CmdletBinding()]</code>, so minimal script could look
like this:</p>
<pre>
<code>[CmdletBinding()] # this line is important to make -verbose work
Param(
# parameters go here
)
Write-Host "I'm a regular message"
Write-Verbose "I'm a verbose message"</code>
</pre>
<p>From AppVeyor you call <code>deploy-verbose.ps1</code> then. If
you use any of AppVeyor system parameters like
<code>-projectName</code> do not forget to declare them in
<code>deploy-verbose.ps1</code> and then pass to
<code>deploy.ps1</code>.</p>
<p>Let me know if it works for you.</p></div>Feodor Fitsnertag:help.appveyor.com,2012-11-13:Comment/308043452014-01-08T10:38:40Z2014-01-08T10:38:41ZHow do I increase the logging level for the deployment log?<div><p>Do I need to do more than add <code>[CmdletBinding()]</code> to
<code>deploy.ps1</code> to print messages with
<code>Write-Verbose</code>?</p>
<p>Do I need some sort of if statement? Sorry I am a bit lost.</p>
<p>Thanks</p></div>Ruperttag:help.appveyor.com,2012-11-13:Comment/308043452014-01-08T17:35:56Z2014-01-08T17:35:56ZHow do I increase the logging level for the deployment log?<div><p>Well, yes, adding <code>[CmdletBinding()]</code> and
<code>param()</code> to deploy.ps1 will allow you to call it from
deploy-verbose.ps1 with -verbose flag.</p>
<p>Do you have any issues with this method?</p>
<p>As for me, I usually prefer old-school way of adding additional
<code>Write-Host</code> statements across the script :)</p></div>Feodor Fitsner