Skip to content

Update User Scripts page - #10

Open
BogdanEmilian wants to merge 3 commits into
cloudbase:mainfrom
BogdanEmilian:user-script-docs-update
Open

BogdanEmilian wants to merge 3 commits into
cloudbase:mainfrom
BogdanEmilian:user-script-docs-update

Conversation

@BogdanEmilian

Copy link
Copy Markdown
Contributor

Provided a more detailed version for the User Script docs, while also adding a short step-by-step guide on how to run them and what to expect

Provided a more detailed version for the User Script docs, while also adding a short step-by-step guide on how to run them and what to expect
@mihaelabalutoiu
mihaelabalutoiu self-requested a review November 13, 2026 11:24

![](_static/images/coriolis-user-scripts-new-transfer.png)

![](_static/images/123.jpg)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these old images are not used any other place, they can be removed from the repo please.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the unused images.
Should I squash the commits into one?

This line was removed by mistake previously. Adding it back to not break any wp reference

@mihaelabalutoiu mihaelabalutoiu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just left two small suggestions on the Windows examples.

"This script ran at $(Get-Date)" | Out-File -FilePath $file -Encoding ascii
```

This has the same result as the after mount example above, with less to write, so you only need one of the two.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "same result" is a bit misleading, since the two examples do different things (one saves script_line1/script_line2, the other writes a file to the Desktop).
What they really share is the mechanism: for a first boot script, Coriolis itself writes it into Cloudbase-Init\LocalScripts (coriolis/osmorphing/windows.py), the same folder the after mount example writes to by hand. Maybe something like:

Suggested change
This has the same result as the after mount example above, with less to write, so you only need one of the two.
This runs through Cloudbase-Init LocalScripts too, like the after mount example above, but Coriolis writes the file for you, so you only need one of the two approaches.

An after mount script can also add a script for Cloudbase-Init to run at first boot:

```powershell
$custom_script = @"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small thing here: the example uses @"…"@, but the text below talks about @'…'@. It's more than a typo, since with double quotes PowerShell expands any $variables when the script runs on the worker, so a user's variables would end up empty in the saved file. Single quotes keep everything as written (docs).

Suggested change
$custom_script = @"
$custom_script = @'
script_line1
script_line2
'@

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants