<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[In what situations is &#96;.AHPARAMETER&#96; expected to do anything?]]></title><description><![CDATA[<p dir="auto">I've been trying to get working some of the behaviours described in <a href="https://docs.inedo.com/docs/otter/scripting-in-otter/otter-scripting-augmented-help" title="Augmented Help" rel="nofollow ugc">Augmented Help</a>, so that Otter might generate rudimentary input UI for my ad-hoc scripts.  However, I must be reading it wrong, because nothing I seem to do with these makes any difference.</p>
<p dir="auto">Consider the rudimentary OtterScript...</p>
<pre><code>/*  .AHPARAMETERS
    .AHPARAMETER TestA(input, text)
    This is a simple test input

    .AHPARAMETER TestB(input, list, values='optA,optB' default='optA')
    This is another test input, with allowed values limited to specific items

    .AHPARAMETER TestC(input, text, sensitive)
    This is a third test input, which might render as a password field
*/
Log-Information "A test -- this is unimportant";
</code></pre>
<p dir="auto">...or a similar rudimentary PowerShell...</p>
<pre><code>&lt;#
.AHPARAMETER TestA(input, text)
.AHPARAMETER TestB(input, list, values='optA,optB' default='optA')
.AHPARAMETER TestC(input, text, sensitive)
#&gt;
Param(
    [String]  $TestA,
    [String]  $TestB,
    [String]  $TestC,
    [Switch]  $TestD
)
Write-Output "A test -- this is unimportant"
</code></pre>
<p dir="auto">When creating an ad-hoc job to run these (i.e. from the <img src="https://forums.inedo.com/assets/plugins/nodebb-plugin-emoji/emoji/android/25b6.png?v=6a0c1edef1b" class="not-responsive emoji emoji-android emoji--arrow_forward" style="height:23px;width:auto;vertical-align:middle" title="▶" alt="▶" /> button in the list within the <em>Scripts</em> screen), I anticipate that input fields should be shown for <code>$Test1</code>, <code>$Test2</code>, <code>$Test3</code>, etc., with certain special attributes applied.</p>
<p dir="auto">However...</p>
<ol>
<li>the <strong>PowerShell</strong> ad-hoc job shows the input parameters derived from the <code>Param</code> block (including a checkbox for <code>$TestD</code>), but does not present a list for <code>$TestB</code>, nor does it mask the sensitive <code>$TestC</code>.</li>
<li>the <strong>OtterScript</strong> ad-hoc job never shows any input parameters <em>at all</em>.</li>
</ol>
<p dir="auto">The only way I can get input parameters to show reliably is to create an associated <em>Job Template</em> and define them there (using the <em>Job Template</em> GUI or directly in the Raft JSON), but that obviously requires keeping two different parameter sets in sync (i.e. the one in the script and the one in the template); and these never apply to an ad-hoc script execution.</p>
<p dir="auto">The implication in the documentation is that Augmented Help is designed to keep this in one place, and is the preferred way to apply these attributes.</p>
<p dir="auto">What am I missing here?  What is the "right" way to document my parameters such that the UI might pick it up?</p>
<hr />
<h4>Some more-targeted stuff I've tried</h4>
<p dir="auto"><em>(this may or may not be relevant...)</em></p>
<p dir="auto">A cursory scan of the decompiled <code>PowerShellScriptParameterInfo.Parse(...)</code> from <em>Scripting.dll</em> suggests that the pattern used to extract values from a comment-based help block only picks these up if they are in the form...</p>
<pre><code>.AHPARAMETER TestC
input, text, sensitive
</code></pre>
<p dir="auto">(i.e. not <code>.AHPARAMETER TestC(input, text, sensitive)</code> as in the documentation.)  I've tried this form, both with and without the surrounding brackets, but it makes no difference.</p>
<p dir="auto">The same decompilation does not refer to <code>AHPARAMETER</code> in the code, although <code>AHEXECMODE</code>, <code>SYNOPSIS</code>, <code>DESCRIPTION</code> and <code>PARAMETER</code> are referenced.</p>
<p dir="auto">The nearest equivalent I can find for OtterScript may be in the decompilation of <code>OtterScriptLanguage</code> in <em>OtterCoreEx.dll</em>, which has methods <code>GetParameters(...)</code> and <code>ParseScriptInfo(...)</code>.  Neither of these seem to mention <code>AHPARAMETER</code> either (although the former has a check for <code>if (!additionalHeader.StartsWith("Parameter")) {...}</code>.  I can't follow it back far enough to see how <code>additionalHeader</code> is populated though.</p>
<p dir="auto">I can see in similar decompilations that the script engines for Batch, Shell and Python seem to favour <code># AhParameters</code> (plural) or <code># AhArgFormat</code> -- I've tried similar strings in my OtterScript and PowerShell scripts (e.g. <code>.AHPARAMETERS</code> and <code>.AHARGFORMAT</code>).</p>
<p dir="auto">I note very similar documentation for BuildMaster (<a href="https://docs.inedo.com/docs/buildmaster/otterscript-execution-engine/buildmaster-scripting-powershell" rel="nofollow ugc">2</a>,<a href="https://docs.inedo.com/docs/buildmaster/otterscript-execution-engine/buildmaster-scripting-augmented-help" rel="nofollow ugc">3</a>) as well, but I haven't got one of those in place with which to test.</p>
]]></description><link>https://forums.inedo.com/topic/5804/in-what-situations-is-.ahparameter-expected-to-do-anything</link><generator>RSS for Node</generator><lastBuildDate>Thu, 06 Aug 2026 00:50:59 GMT</lastBuildDate><atom:link href="https://forums.inedo.com/topic/5804.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 04 Aug 2026 23:52:26 GMT</pubDate><ttl>60</ttl></channel></rss>