Skip to main content

writing scripts

Scripts are created from the new script button on the scripts page, which requires automation:create. You can describe what you want in plain English and let the AI builder write it, or write it yourself.

the three views​

The new-script page opens on the AI builder and moves through up to three views.

1. AI builder​

The default view asks "what do you want your script to do?" and gives you a large text box. Type a description of the job and press Generate Script — or use Ctrl+Enter (Cmd+Enter on a Mac) to submit.

ControlNotes
Description boxPlain English. Ctrl/Cmd+Enter submits
Language dropdownLabelled by platform — Windows – PowerShell, Linux – Bash, Windows – Batch, Cross-platform – Python
Generate ScriptSends the description for generation
ExamplesA disclosure with eight ready-made prompts to start from
I know how to write codeSkips straight to the manual form
note

Generation typically takes 15 to 40 seconds. Long or complex requests can time out, in which case you are asked to try again. Shortening the description or splitting the job into two scripts usually gets a result.

2. AI review​

Once generation finishes you land on a review view carrying an AI Generated badge. Here you can:

  • edit the Script Name and Description,
  • read and edit the generated code in place in a full editor.
Footer buttonDoes
Customize in Full EditorMoves everything into the manual form so you can set parameters, timeout, platforms and tags
RegenerateAsks for another attempt
Create ScriptSaves the script as it stands
tip

Always read generated code before creating the script, and prefer Customize in Full Editor if the script needs parameters — parameters can only be defined at creation time and cannot be added afterwards.

3. manual form​

The full editor is four cards plus a footer.

Basic Information​

FieldNotes
Script NameRequired, maximum 255 characters
Description
LanguagePowerShell, Bash, Batch or Python
Execution Timeout1, 2, 5 (default), 10, 15, 30 minutes or 1 hour
Target PlatformsToggles — at least one is required
TagsSearchable from the scripts list
Save as TemplateA switch on the card

Script Content​

A code editor, plus a collapsible Variable Reference panel documenting the syntax available to you — credentials, environment variables and script parameters. The panel is language-aware, so it shows the syntax for the language you have selected.

Parameters​

Add Parameter appends a row. Each parameter has:

FieldOptions
Name
TypeString, Number, Boolean, Array
Description
Default Value
RequiredA switch

On an existing script, the same fields are editable from the Parameters tab — add, change or remove parameters and Save parameters.

languages and platforms​

Choosing a language automatically sets sensible target platforms:

LanguagePlatforms set
PowerShellWindows
BatchWindows
BashLinux
PythonWindows, Linux, macOS

You can override the toggles, but at least one platform must stay selected.

note

Switching language replaces the editor's starter boilerplate only if you have not written anything yet. Code you have written is never overwritten.

info

One summary card in the product describes the supported languages as "PowerShell, Bash, and Python". Batch is supported too — it is available in the language dropdown and runs on Windows.

approval status​

Every script carries an approval status, and only approved scripts can run. Specifically:

  • Run Script is disabled unless the script is approved.
  • Scheduled runs skip unapproved scripts.
  • Trigger URLs can only be generated for approved scripts.

In practice, every script created through the portal — whether AI-generated, written by hand, or installed from a template — is approved as soon as it is created. There is no approval queue and no approve or reject screen. The status is worth knowing about because of what it gates, not because it is something you need to action.

the script detail page​

Opening a script from the library gives you its full record.

The name, description, creator, created date and language, plus the script ID, which you can click to copy.

ButtonAvailability
Run ScriptHidden without automation:execute; disabled unless the script is approved
Generate URLOnly on approved scripts. See trigger URLs
EditChanges the name and description
DeleteBlocked while the script has any schedules
caution

A script with one or more schedules cannot be deleted. The delete dialog says so and the action is disabled. Delete or repoint the schedules first — see schedules.

Four stat cards sit under the header: Executions, Schedules, Version and Timeout.

tabs​

TabContents
ScriptExecution Timeout dropdown, Modify with AI, the code editor, the Variable Reference panel and tags
ParametersRead-only — see the caution above
Version HistoryOne card per version, with a Current badge and the changelog
SchedulesA card for every schedule using this script
ExecutionsPaginated, with status and trigger filters

Any edit on the Script tab raises a floating Save / Cancel bar. Nothing is committed until you save.

versioning​

A new version is created only when the script content actually changes. Editing the timeout, the name or the description does not create a version, so the Version History tab stays a record of real code changes rather than metadata churn.

Modify with AI​

Modify with AI opens a dialog that takes the current script as context. It offers a target language select, a prompt box and eight example prompts.

caution

The result replaces the content of the editor but is not saved automatically. Review it, then use the floating Save bar. Navigating away without saving discards the change.

template-installed scripts​

Scripts installed from the gallery show a banner naming the source template, the installed version and the install date.

When PosKit publishes a newer version, the banner turns amber and offers Update from Template, which opens a diff view so you can see exactly what changes before accepting it.