mirror of
https://github.com/amidaware/tacticalrmm.git
synced 2026-04-26 15:05:57 +03:00
[GH-ISSUE #2235] [Feature Request] Multiple Scripts in Script Editor #3336
Labels
No labels
In Process
bug
bug
dev-triage
documentation
duplicate
enhancement
fixed
good first issue
help wanted
integration
invalid
pull-request
question
requires agent update
security
ui tweak
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tacticalrmm#3336
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @adamjrberry on GitHub (May 27, 2025).
Original GitHub issue: https://github.com/amidaware/tacticalrmm/issues/2235
Is your feature request related to a problem? Please describe.
Not an issue, but would be neater. Currently, if creating a script that would be used by all three OS', you only have the option of picking one language and creating 1 script, unless you create 3 separate scripts.
Describe the solution you'd like
It would be cool if the 'Shell Type' dropdown had a 'Multiple Scripts' option or similar, and then the user could create individual scripts per OS within the overall script. This would allow a user to create 1 script that could use Powershell on Windows, Bash on Linux & MacOS etc. Editor could look similar to below:
This would allow a user to select a script from the drop-down when executing a script in TRMM, and it will pick the correct script based on the OS.
Describe alternatives you've considered
Having separate scripts per OS - resulting in 3 scripts doing the same thing for different OS'
Using a cross-platform language - which is probably preferred but it's nice to still be able to use PS,bash etc..
Additional context
Screenshot above.
@P6g9YHK6 commented on GitHub (May 27, 2025):
not tested trough trmm but works fine without
Your friendly chaos code enjoyer.
edit:
chat gpt say use python y'a crazy
@NiceGuyIT commented on GitHub (May 30, 2025):
Nushell is by far the best language out there. It supports many file formats natively, supports http requests, has a robust set of commands built in, and has a plugin system to add extra flexibility not available natively.
If you want OS specific functionality, call the OS-specific commands. For Windows, call Powershell and ConvertTo-Json to convert the output to JSON for processing. For Linux and maybe macOS, install jc to run commands that output JSON.
If that's not enough, Nushell has native support for SQLite! And the stor commands give you access to an in-memory SQLite database, essential for storing secrets across function calls.
While Nushell is a scripting language, Deno is a programming language and brings in the rich NPM ecosystem. Deno is a single binary and the deno compile command creates a single binary! This means you can write a program to call
deno compile https://github.com/example/repo/src/main.jsto create a single binary that can be used for startup or login commands, scheduled tasks, etc. While the NPM ecosystem is useful for web things, it is less useful for MSP things. I included it because it's a single binary that is cross platform.Thinking about what can be done with the web, deno serve will start a web server for interactive usage. Imagine opening a page that Deno is serving, the user enters information like a problem ticket, and Deno sends it to your ticketing system. The only limitation is your lack of knowledge about what is possible.
Going back to your original question about having 3 different scripts for each OS, you can do that today with script snippets. Create a separate snippet for each OS and then include it in the main script with Nushell. Depending on how you write the snippet, Nushell can save the script and then execute it or execute it directly.
I hope this opened your mind to what's possible. If you are interested in learning more about Nushell, they have an active Discord with very friendly people. Be careful, once you go Nushell, you will never go back!
@adamjrberry commented on GitHub (May 31, 2025):
Hi @NiceGuyIT , that's some interesting reading and admittedly I have never used the Nushell or Deno options in the TRMM Scripting IDE. That does indeed sound like a great solution, and I did mention the possibility of using a cross-platform language in my original post.
I raised the feature request really as a 'nice to have' rather than a 'need' , at least for me personally. I have built some cross-platform scripts with the likes of Python etc which worked well. I was using another platform that had this function where you click 'New Script' and then it gives you the option of defining an individual script per OS, which felt neat.
However, it looks like the snippets that you mention may fulfil that requirement anyway!
Really appreciate the in-depth comment and I will definitely play around with Nushell - it looks incredibly powerful!
Cheers :-) - I'll close this FR now as it looks like it's probably redundant with the available options.
@silversword411 commented on GitHub (Jun 1, 2025):
Have you done any performance comparisons between the languages yet?
PS is super slow, py is usually 20x faster
Love these writeups, keep 'em coming! I'll dive into the new-nu sometime soon