Environment variables value pass to powershell script in prep command #496
-
Since my monitors setup is a bit complex, e.g. 2 external monitors(through a KVM switch, so these monitors might connect to another PC sometimes) + 1 pikvm + 1 emulated monitor, I need a program solution to handle all scenario. My goal is to always set the virtual monitor as primary monitor and change the resolution, refresh rate and HDR setting automatically, and revert back when stream ends. Here I choose Powershell because:
So I decided to write a Powershell script and made Sunshine to call the script. The prep command like: It's clear that the script will accept 4 parameters: action, width, height, fps. You can easily tell the usage by their names. However, there is an issue when I tried to print these values in Powershell script, e.g: What I got is something like: That means these environment variables are not correctly expand with their actual value. I also tried below prep command but no luck: Anybody know how to fix? |
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 6 replies
-
Well you're using cmd's method instead of powershell's. You can just access the env variables inside your script. They don't need to be arguments... Or you can Google how to pass env variables to powershell? |
Beta Was this translation helpful? Give feedback.
You aren't using
cmd
in Sunshine though. Sunshine doesn't run commands in any terminal. You can use cmd syntax if you prefix your command withcmd /c
though.