Is it possible to run Powershell commands with a variable made in Node-Red/Home Assistant?

I have a input_select that has options for filenames. Is it possible to have that filename be sent into a message payload and have HASS agent receive it and launch a powershell process with the matching file on the computer?
Solution:
Ya, commands/custom commands can "accept" parameters sent with the action (if I'm not mistaken configuring an empty one and then sending the absolute path to script as action payload should just launch it) Although I must put it out there: from the security perspective that's not desirable :P...
Jump to solution
4 Replies
DrR0x
DrR0x5mo ago
It should be, Ive never done it personally. I can try it out in a couple hours, @Amadeo may know
Solution
Amadeo
Amadeo5mo ago
Ya, commands/custom commands can "accept" parameters sent with the action (if I'm not mistaken configuring an empty one and then sending the absolute path to script as action payload should just launch it) Although I must put it out there: from the security perspective that's not desirable :P
MarcoMadnesss
MarcoMadnesss5mo ago
Interesting. Is there a more secure alternative? Would enabling ssl help?
Amadeo
Amadeo5mo ago
I mean, the main point to secure would be MQTT broker itself and all devices that can send MQTT messages - since after configuring HASS.Agent to execute all it receives for specific command, every device that has connection to MQTT could execute technically "anything" on your pc
Want results from more Discord servers?
Add your server